grouper-users - RE: RE: [grouper-users] assignPermissions
Subject: Grouper Users - Open Discussion List
List archive
- From: Chris Hyzer <>
- To: mohan shamachar <>, "" <>
- Subject: RE: RE: [grouper-users] assignPermissions
- Date: Thu, 7 Feb 2013 19:13:23 +0000
- Accept-language: en-US
I ran this and it worked. This is from the 2.1 branch which is essentially
2.1.3... does it work for you?
import edu.internet2.middleware.grouperClient.api.GcAssignPermissions;
import
edu.internet2.middleware.grouperClient.ws.beans.WsAssignPermissionsResults;
/**
*
*/
public class AssignPermissionsPoc {
/**
* @param args
*/
public static void main(String[] args) {
WsAssignPermissionsResults wsAssignPermissionsResults = new
GcAssignPermissions().addAction("assign")
.addPermissionDefNameName("test:poc:pocPerm").addRoleName("test:poc:pocRole")
.assignPermissionAssignOperation("assign_permission").assignPermissionType("role").execute();
System.out.println(wsAssignPermissionsResults.getResultMetadata().getResultCode());
}
}
######### REQUEST
POST /grouperWs/servicesRest/v2_1_001/permissionAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8088
Content-Length: 448
Content-Type: text/xml; charset=UTF-8
<WsRestAssignPermissionsRequest>
<permissionAssignOperation>assign_permission</permissionAssignOperation>
<permissionType>role</permissionType>
<permissionDefNameLookups>
<WsAttributeDefNameLookup>
<name>test:poc:pocPerm</name>
</WsAttributeDefNameLookup>
</permissionDefNameLookups>
<roleLookups>
<WsGroupLookup>
<groupName>test:poc:pocRole</groupName>
</WsGroupLookup>
</roleLookups>
<actions>
<string>assign</string>
</actions>
</WsRestAssignPermissionsRequest>
####################### RESPONSE
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=C9E309***********************; Path=/grouperWs
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: text/xml;charset=UTF-8
Date: Thu, 07 Feb 2013 19:09:38 GMT
Connection: close
<WsAssignPermissionsResults>
<wsAttributeDefs>
<WsAttributeDef>
<extension>pocPermDef</extension>
<name>test:poc:pocPermDef</name>
<uuid>d25e3bd0778e484e94a87ef083fc3847</uuid>
<attributeDefType>perm</attributeDefType>
<multiAssignable>F</multiAssignable>
<multiValued>F</multiValued>
<valueType>marker</valueType>
</WsAttributeDef>
</wsAttributeDefs>
<wsAttributeDefNames>
<WsAttributeDefName>
<extension>pocPerm</extension>
<displayExtension>pocPerm</displayExtension>
<displayName>test:poc:pocPerm</displayName>
<name>test:poc:pocPerm</name>
<uuid>02881f8abad24ff396572494ddfceb28</uuid>
<attributeDefId>d25e3bd0778e484e94a87ef083fc3847</attributeDefId>
<attributeDefName>test:poc:pocPermDef</attributeDefName>
</WsAttributeDefName>
</wsAttributeDefNames>
<wsAssignPermissionResults>
<WsAssignPermissionResult>
<wsAttributeAssigns>
<WsAttributeAssign>
<disallowed>F</disallowed>
<attributeAssignActionType>immediate</attributeAssignActionType>
<attributeAssignDelegatable>FALSE</attributeAssignDelegatable>
<attributeAssignActionId>82e3408c2f1f4d668534815a453abd14
</attributeAssignActionId>
<attributeAssignActionName>assign</attributeAssignActionName>
<attributeAssignType>group</attributeAssignType>
<attributeDefNameId>02881f8abad24ff396572494ddfceb28</attributeDefNameId>
<attributeDefNameName>test:poc:pocPerm</attributeDefNameName>
<attributeDefId>d25e3bd0778e484e94a87ef083fc3847</attributeDefId>
<attributeDefName>test:poc:pocPermDef</attributeDefName>
<createdOn>2013/02/07 14:09:37.560</createdOn>
<enabled>T</enabled>
<id>6ffd55df49a44920a75724ad8caf2de6</id>
<lastUpdated>2013/02/07 14:09:37.560</lastUpdated>
<ownerGroupId>be74c24e912a443f9c672f0615816e07</ownerGroupId>
<ownerGroupName>test:poc:pocRole</ownerGroupName>
</WsAttributeAssign>
</wsAttributeAssigns>
<changed>T</changed>
<deleted>F</deleted>
</WsAssignPermissionResult>
</wsAssignPermissionResults>
<resultMetadata>
<resultCode>SUCCESS</resultCode>
<resultMessage>, Found 1 results. </resultMessage>
<success>T</success>
</resultMetadata>
<responseMetadata>
<resultWarnings></resultWarnings>
<millis>14216</millis>
<serverVersion>2.1.3</serverVersion>
</responseMetadata>
<wsGroups>
<WsGroup>
<extension>pocRole</extension>
<typeOfGroup>role</typeOfGroup>
<displayExtension>pocRole</displayExtension>
<displayName>test:poc:pocRole</displayName>
<name>test:poc:pocRole</name>
<uuid>be74c24e912a443f9c672f0615816e07</uuid>
</WsGroup>
</wsGroups>
<wsSubjects />
</WsAssignPermissionsResults>
-----Original Message-----
From:
[mailto:]
On Behalf Of mohan shamachar
Sent: Thursday, February 07, 2013 1:09 PM
To:
Subject: Re: RE: [grouper-users] assignPermissions
Thanks Chris.
I'm sending this request... however, the error says:
WARN WsAssignAttributesResults.assignResultCodeException(263) - <
GrouperSystem - 10.214.38.160 > -
edu.internet2.middleware.grouper.ws.exceptions.WsInvalidQueryException: You
need to pass in an attributeDefName lookup.
<WsRestAssignPermissionsRequest>
<permissionAssignOperation>assign_permission</permissionAssignOperation>
<permissionType>role</permissionType>
<permissionDefNameLookups>
<WsAttributeDefNameLookup>
<uuid></uuid>
<name>aStem:permissionDefName</name>
</WsAttributeDefNameLookup>
</permissionDefNameLookups>
<roleLookups>
<WsGroupLookup>
<groupName>aStem:role</groupName>
</WsGroupLookup>
</roleLookups>
<actions>
<string>write</string>
</actions>
</WsRestAssignPermissionsRequest>
Thank you.
- mohan
- [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: RE: RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: RE: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: RE: RE: RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: RE: RE: RE: [grouper-users] assignPermissions, mohan shamachar, 02/08/2013
- Re: RE: RE: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: RE: RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
- Re: RE: [grouper-users] assignPermissions, mohan shamachar, 02/07/2013
- RE: [grouper-users] assignPermissions, Chris Hyzer, 02/07/2013
Archive powered by MHonArc 2.6.16.