SAP Sponsorships Engine Security Webservices API

URL: /api/restsecurity/usergroup

Description:

The service creates reads, updates or deletes a UserGroups and can add and remove users and roles from/to UserGroups, based on the HTTP method used.


Get a UserGroup by its group ID or group name
Request Method: GET
Output format: a JSON document of the following format
{ "id": "31333349-caf7-4c03-ad34-f90e07ad5434", "groupName": "My Test Group", "users": [ "admin", "testuser" ], "roles": [ { "role_id": "c42948df-517b-45cb-9fa9-d1e79f18e115", "role_name": "sailing_viewer", "associated": false } ]}
Parameter:
groupId: Unique ID of the UserGroup, provided as a path parameter.
groupName: Unique name of the UserGroup.
At least the ID or the name of the group needs to be provided to get detailed information about the UserGroup.
Example: curl "http://admin:admin@127.0.0.1:8888/security/api/restsecurity/usergroup/31333349-caf7-4c03-ad34-f90e07ad5434"
curl "http://admin:admin@127.0.0.1:8888/security/api/restsecurity/usergroup?groupName=My%20Test%20Group"
Will provide a JSON document as explained above.

Create a new UserGroup
Request Method: PUT
Output format: a JSON document of the following format
{ "id": "9201d7cb-969e-4975-8cf1-32972bb2c8ba", "groupName": "My Test Group", "users": [ "admin" ], "roles": [] }
Parameter (JSON Body):
groupName
Unique name of the UserGroup to create.
Example: curl -X PUT -d '{"groupName": "My TestGroup"}' "http://admin:admin@127.0.0.1:8888/security/api/restsecurity/usergroup"
Will provide a JSON document as explained above.

Delete UserGroup
Request Method: DELETE {groupId}
Output format: An Empty response with status code 204 in case of success; error-indicating status codes otherwise
Mandatory path parameters:
groupId
The UUID of the UserGroup to remove.
Example: curl -X DELETE "127.0.0.1:8888/security/api/restsecurity/usergroup/9201d7cb-969e-4975-8cf1-32972bb2c8ba"

Add a user to a UserGroup
Request Method: PUT {groupId}/user/{username}
Output format: Empty body with preferably status code 200
Path Parameter:
groupId
UUID of the UserGroup to add the user to.
username
Unique name of the user to add to the UserGroup.
Example: curl -X PUT "http://admin:admin@127.0.0.1:8888/security/api/restsecurity/usergroup/9201d7cb-969e-4975-8cf1-32972bb2c8ba/user/testuser"

Delete a user from a UserGroup
Request Method: DELETE {groupId}/user/{username}
Output format: Empty body with preferably status code 204
Path Parameter:
groupId
UUID of the UserGroup to remove the user from.
username
Unique name of the user to remove from the UserGroup.
Example: curl -X DELETE "127.0.0.1:8888/security/api/restsecurity/usergroup/9201d7cb-969e-4975-8cf1-32972bb2c8ba/user/testuser"

Add a role to a UserGroup
Request Method: PUT {groupId}/role/{roleId}
Output format: Empty body with preferably status code 200
Parameter:
groupId (Path)
Unique name of the UserGroup to add the role to.
roleId (Path)
Unique ID of the role to add to the UserGroup.
forAll (JSON Body)
True or false, depending whether the role's permissions are applied regardless of the user performing the access, only requiring the object access to be owned by this group; otherwise, the role's permissions are only granted if the object accessed is owned by this group and the user performing the access belongs to this group.
Example: curl -X PUT -d '{"forAll": true}' "127.0.0.1:8888/security/api/restsecurity/usergroup/9201d7cb-969e-4975-8cf1-32972bb2c8ba/role/29914406-b0fc-43cd-acc7-62a83931f587"

Delete a role from a UserGroup
Request Method: DELETE {groupId}/role/{roleId}
Output format: Empty body with preferably status code 204
Path Parameter:
groupId
UUID of the UserGroup to remove the role from.
roleId
UUID of the role to remove from the UserGroup.
Example: curl -X DELETE "127.0.0.1:8888/security/api/restsecurity/usergroup/9201d7cb-969e-4975-8cf1-32972bb2c8ba/role/29914406-b0fc-43cd-acc7-62a83931f587"