Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-1961

gsh findSubject mixes type and source when passed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.5.0, 2.4.1
    • 2.4.0, 2.3.0.patch
    • gsh
    • None

    Description

      The two-argument findSubject(id, source) ignores the source.

       

      groovy:000> findSubject("grouper-wsuser", "INVALID_SOURCE")
      ===> Subject id: grouper-wsuser, sourceId: jdbc, name: grouper-wsuser
      

       

      It needs a middle argument in order to work.

       

      groovy:000> findSubject("grouper-wsuser", null, "INVALID_SOURCE")
      ERROR edu.internet2.middleware.subject.SourceUnavailableException:
      Cant find source with id: 'INVALID_SOURCE', Possible source id's: 'g:isa', 'g:gsa', 'grouperEntities', 'grouperExternal', 'jndi', 'jdbc',
       
      groovy:000> s = findSubject("grouper-wsuser", null, "jdbc")
      ===> Subject id: grouper-wsuser, sourceId: jdbc, name: grouper-wsuser
      

       

      The middle value per groovysh.profile is supposed to be type. But it's ignored because there is no 3-argument findUser java method. There is only a 2-argument method, and the second argument is source.

       

      groovy:000> s = findSubject("grouper-wsuser", "person", "jdbc")
      ===> Subject id: grouper-wsuser, sourceId: jdbc, name: grouper-wsuser
      groovy:000> s = findSubject("grouper-wsuser", "INVALID_TYPE", "jdbc")
      ===> Subject id: grouper-wsuser, sourceId: jdbc, name: grouper-wsuser
       
      groovy:000> s.type
      ===> person
      

      Attachments

        Activity

          People

            chad.redman@at.internet2.edu Chad Redman (unc.edu)
            chad.redman@at.internet2.edu Chad Redman (unc.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: