gsh findSubject mixes type and source when passed

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • 2.5.0, 2.4.1
    • Affects Version/s: 2.4.0, 2.3.0.patch
    • Component/s: gsh
    • None

      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
      

            Assignee:
            Chad Redman (unc.edu) (Inactive)
            Reporter:
            Chad Redman (unc.edu) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: