Assigning multiple users to a role for a folderSince 8/2015
Added by IBM contributorElizabeth Bowling | Edited by IBM contributorElizabeth Bowling on August 21, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Assign multiple users or multiple groups to a folder's access role in a single operation.

This method requires authentication.


To assign a user or group to an access role, the currently authenticated user must be either: the owner of the folder, an administrator, or a user who has received GrantAccess permission on the folder. GrantAccess permission is given through the Manager access role. To test whether the current user can assign a user or group to a role, use the API for Retrieving the list of members for a folder's role to see if the user belongs to the Manager Role.

Note : When a user/group is assigned to a new role, the old role is automatically deleted.

The following access roles are available:

 

Role Type
Permissions
Reader
View a folder and all media in it.
Contributor
Add to a folder and delete items they added.
Manager
Add and remove any item; assign roles.

The following error codes could appear in a response body for an invalid request:

 

Error Code
Description
Unknown
Returned when the cause of an error is unknown
AccessDenied
Returned when the cause of an error is due to a permission restriction
ItemNotFound
Returned when the cause of an error is related to a resource not being found
ItemExists
Returned when the cause of an error is related to a conflict with an existing resource
Unsupported Operation
Returned when the operation is not supported
ConstraintViolation
Returned when a constraint is violated such as description or summary being too long
Input
Method URI Description
POST /files/{auth}/api/collection/{collection-id}/roles/ Assign users or groups to a role for the specified folder.
POST /files/{auth}/api/communitycollection/{community-id}/roles/ Assign users or groups to the role for the specified folder.
Name Type Optional Description
auth
enumerated No The authorization protocol being used by your application to access Connections Cloud.
Authorized values:
  • basic
  • oauth
collection-id
string No The UUID of the folder that the role is assigned to.
community-id
string No The UUID of the community folder that the role is assigned to.
Name Type Optional Description
sendNotification
enumerated Yes Determines whether a notification will be sent out when sharing a collection. The default value is true (notification will be sent).
Authorized values:
  • true
  • false
visibility
enumerated Yes Change the visibility as indicated.
Authorized values:
  • public
  • private
Name Type Optional Description
Authorization
enumerated No The authentication mechanism selected by your application to access the API.
Basic is the Base64 encoding of the IBM Connections Cloud username and password: Base64(username:password). For example, Base64(twatson@us.ibm.com:password).
Bearer is the oauth 2.0 access token that is generated when the user grants your application access to IBM Connections Cloud services.
See the reference topic "OAuth 2.0 APIs for web server flow" for more information.
Authorized values:
  • basic
  • bearer
Output
Code Description
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.