Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] finding privileges on groups via WS interface

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] finding privileges on groups via WS interface


Chronological Thread 
  • From: Martin van Es <>
  • To: Chris Hyzer <>, Grouper Users Mailing List <>
  • Subject: Re: [grouper-users] finding privileges on groups via WS interface
  • Date: Wed, 4 Mar 2009 22:04:39 +0100

Hi Chris,

I'm trying the new params in getGroups to collect all groups for which the
supplied subject is admin using the following SOAP request:

<ns1:getGroups>
<ns1:clientVersion>v1_4_000</ns1:clientVersion>
<ns1:subjectLookups>
<ns1:subjectId>SURFnetShowcase.joe</ns1:subjectId>
</ns1:subjectLookups>
<ns1:memberFilter></ns1:memberFilter>
<ns1:includeGroupDetail>true</ns1:includeGroupDetail>
<ns1:includeSubjectDetail>false</ns1:includeSubjectDetail>
<ns1:subjectAttributeNames></ns1:subjectAttributeNames>
<ns1:params>
<ns1:paramName>fieldName</ns1:paramName>
<ns1:paramValue>admins</ns1:paramValue>
</ns1:params>
</ns1:getGroups>

But the answer contains no valid groups (and I'm very sure
SURFnetShowcase.joe
is admin for at least one group). The thing that worries me is the params
part
in the resultMessage:

Success for: clientVersion: v1_4_000, subjectLookups: Array size: 1: [0]:
WsSubjectLookup[subjectId=SURFnetShowcase.joe]
memberFilter: All, includeGroupDetail: false, actAsSubject: WsSubjectLookup[]
, params: Empty array


It says "params: Empty" array which it defenately isn't! What am I missing?

Regards,
Martin


On Monday 23 February 2009 19:43:25 Chris Hyzer wrote:
> I looked into it, and found out why I never added it to WS, because the
> grouper API doesn't have a method for it. :)
>
> Anyways, I added it, feel free to get latest from the 1.4 branch, and try
> it out. I need to do more testing before closing the bug, but the test I
> did through a WS call worked fine.
>
> cvs
> -d:pserver::/home/cvs/i2mi
> login
> cvs
> -d:pserver::/home/cvs/i2mi
> export -r
> GROUPER_1_4_BRANCH grouper cvs
> -d:pserver::/home/cvs/i2mi
> export -r
> GROUPER_1_4_BRANCH grouper-ws
>
> https://bugs.internet2.edu/jira/browse/GRP-232
>
> I added the API:
>
> gsh 0% subj = findSubject("10021368")
> subject: id='10021368' type='person' source='pennperson' name='Chris Hyzer'
> gsh 1% sess = GrouperSession.start(subj)
> edu.internet2.middleware.grouper.GrouperSession:
> 8d17a97d-3d1a-4e39-a44c-01a3fead792d,'10021368','person' gsh 2% member =
> MemberFinder.findBySubject(sess, subj)
> member: id='10021368' type='person' source='pennperson'
> uuid='6512f26a-98b5-486c-bc94-ac26e0d9a7ca' gsh 3% field =
> FieldFinder.find("admins")
> access privilege: 'admins'
> gsh 4% member.getGroups(field);
> group: name='aStem:whateverGroup2' displayName='aStem:disp2'
> uuid='b3be109a-afb6-49d0-8aaf-73cbd130f967' group: name='aStem:aGroup'
> displayName='aStem:aGroup' uuid='4992b987-3329-418e-ba83-9d9335305902'
> group: name='aStem:whateverGroup' displayName='aStem:disp1'
> uuid='2703916b-ac8a-4830-9a60-698a3b1faf97' gsh 5%
>
> Then I added a param on the getGroups web services (all flavors, though
> here is an example in rest batch):
>
> <WsRestGetGroupsRequest>
> <subjectLookups>
> <WsSubjectLookup>
> <subjectId>10021368</subjectId>
> </WsSubjectLookup>
> <WsSubjectLookup>
> <subjectId>10039438</subjectId>
> </WsSubjectLookup>
> </subjectLookups>
> <actAsSubjectLookup>
> <subjectId>GrouperSystem</subjectId>
> </actAsSubjectLookup>
> <params>
> <WsParam>
> <paramName>fieldName</paramName>
> <paramValue>admins</paramValue>
> </WsParam>
> </params>
> </WsRestGetGroupsRequest>
>
> This will result in the following response (which looks like the normal
> response, with the exception of the description):
>
> <WsGetGroupsResults>
> <results>
> <WsGetGroupsResult>
> <wsGroups>
> <WsGroup>
> <extension>whateverGroup2</extension>
> <displayExtension>disp2</displayExtension>
> <description>descs</description>
> <displayName>aStem:disp2</displayName>
> <name>aStem:whateverGroup2</name>
> <uuid>b3be109a-afb6-49d0-8aaf-73cbd130f967</uuid>
> </WsGroup>
> <WsGroup>
> <extension>aGroup</extension>
> <displayExtension>aGroup</displayExtension>
> <displayName>aStem:aGroup</displayName>
> <name>aStem:aGroup</name>
> <uuid>4992b987-3329-418e-ba83-9d9335305902</uuid>
> </WsGroup>
> <WsGroup>
> <extension>whateverGroup</extension>
> <displayExtension>disp1</displayExtension>
> <description>desc1</description>
> <displayName>aStem:disp1</displayName>
> <name>aStem:whateverGroup</name>
> <uuid>2703916b-ac8a-4830-9a60-698a3b1faf97</uuid>
> </WsGroup>
> </wsGroups>
> <resultMetadata>
> <resultCode>SUCCESS</resultCode>
> <success>T</success>
> </resultMetadata>
> <wsSubject>
> <resultCode>SUCCESS</resultCode>
> <success>T</success>
> <id>10021368</id>
> <sourceId>pennperson</sourceId>
> </wsSubject>
> </WsGetGroupsResult>
> <WsGetGroupsResult>
> <resultMetadata>
> <resultCode>SUCCESS</resultCode>
> <success>T</success>
> </resultMetadata>
> <wsSubject>
> <resultCode>SUCCESS</resultCode>
> <success>T</success>
> <id>10039438</id>
> <sourceId>pennperson</sourceId>
> </wsSubject>
> </WsGetGroupsResult>
> </results>
> <resultMetadata>
> <resultCode>SUCCESS</resultCode>
> <resultMessage>
> Success for: clientVersion: v1_4_001, subjectLookups: Array size: 2:
> [0]:
> edu.internet2.middleware.grouper.ws.soap.WsSubjectLookup@14b2db7[subject=&l
>t;null&gt;,member=&lt;null&gt;,cause=&lt;null&gt;,causeMember=&lt;null&gt;,s
>ubjectFindResult=&lt;null&gt;,memberFindResult=&lt;null&gt;,su...
> memberFilter: All, includeGroupDetail: false, actAsSubject:
>
> edu.internet2.middleware.grouper.ws.soap.WsSubjectLookup@6c9220[subject=&lt
>;null&gt;,member=&lt;null&gt;,cause=&lt;null&gt;,causeMember=&lt;null&gt;,su
>bjectFindResult=&lt;null&gt;,memberFindResult=&lt;null&gt;,subjectId=Grouper
>System,subjectIdentifier=&lt;null&gt;,subjectSourceId=&lt;null&gt;] ,
> params: Array size: 1: [0]:
>
> edu.internet2.middleware.grouper.ws.soap.WsParam@1ed7524[paramName=fieldNam
>e,..., field: admins
> </resultMessage>
> <success>T</success>
> </resultMetadata>
> <responseMetadata>
> <millis>6437</millis>
> <serverVersion>v1_4_002</serverVersion>
> </responseMetadata>
> </WsGetGroupsResults>
>
> Regards,
> Chris
>
> > -----Original Message-----
> > From: Scott Koranda
> > [mailto:]
> > Sent: Monday, February 23, 2009 12:16 PM
> > To: Chris Hyzer
> > Cc: Grouper Users Mailing List
> > Subject: Re: [grouper-users] finding privileges on groups via WS
> > interface
> >
> > Hi,
> >
> > > Doesn't look like it is possible. Should have been an
> > > option in getGroups(), not sure if there was a reason it was
> > > omitted. Anyways, when do you need it?
> >
> > I can work around it for now.
> >
> > Would it be possible for the 1.4.2 release or would it break
> > backwards compatibility with 1.4.[0|1]?
> >
> > Or should it wait for 1.5?
> >
> > Cheers,
> >
> > Scott
> >
> > > Thanks, Chris
> > >
> > > > -----Original Message----- From: Scott Koranda
> > > > [mailto:]
> > > > Sent: Monday,
> > > > February 23, 2009 11:01 AM To: Grouper Users Mailing List
> > > > Subject: [grouper-users] finding privileges on groups via
> > > > WS interface
> > > >
> > > > Hi,
> > > >
> > > > I learned recently that I can find all the subjects that
> > > > have a privilege like 'UPDATE' on a group using the web
> > > > services interface by invoking the getMembers operation
> > > > and specifying the fieldName parameter as 'updaters'.
> > > >
> > > > Is there a WS operation that I can invoke to find all
> > > > groups for which a particular subject has the 'UPDATE'
> > > > privilege?
> > > >
> > > > Scott



Archive powered by MHonArc 2.6.16.

Top of Page