Get Folder Permissions for the Calling User

Gets the permissions that are associated with a folder for a specific user.

This command allows the application to determine what a user's permissions are with regard to a specific folder without having to try running an action. The returned information describes which actions (Read, List, Delete, and so on) the user can perform against the target folder.

Note: For more information about this command, including descriptions of any path and request parameters, request body schema, response codes and schemas, and payload examples, refer to the online API reference for this command at the following web page:

Get folder permissions for the calling user

URI

https://bartendercloud.com/api/librarian/folders/{folderId}/userpermissions

Note: The bartendercloud.com domain that is referenced in the URI and in the code example that follows must be replaced with the contents of the DataCenterURI claim that is extracted from your access token. For more information, refer to Extracting the DataCenterURI Claim.

Path Parameters

folderId

Type: String

Specifies the ID of the folder. Required.

Query Parameters

None.

Example

Request body: None.

Response: See UserFolderPermissions.

Copy
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");

// Assume that folderId is the ID of the target folder.
HttpResponseMessage msg = await client.GetAsync($"https://bartendercloud.com/api/librarian/folders/{folderId}/userpermissions");

if (msg.IsSuccessStatusCode)
{
   var response = await msg.Content.ReadAsStringAsync();
   return JsonConvert.DeserializeObject<UserFolderPermissions>(response);
}