You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
bmilinski
6 years agoHelpful | Level 6
How to get each team member's permissions per folder using .NET Dropbox API?
I am trying to go through all the members of my Dropbox and find out their permissions on every folder, but I'm not sure how to do this. I am new to the API, so help would be appreciated. I am writin...
- 6 years ago
[Cross-linking for reference: https://stackoverflow.com/questions/59272078/dropbox-api-how-to-see-each-team-members-folder-permissions#59272078 ]
When you list files and folders using FilesUserRoutes.ListFolderAsync like this, you're listing the contents of the member's Dropbox folder, which will include both shared folders (where they have some specific permission level) as well as their private folders (where they don't have a specific permission level, since it's just their folders). For shared folders, the returned FolderMetadata.SharingInfo will be set, but it doesn't contain information about that user's permission level in that folder. (By the way, make sure you implement ListFolderContinueAsync as well, to make sure you can retrieve all results, when using ListFolderAsync. Check out the ListFolderAsync documentation for more information.)
Instead, if you want to list the shared folders the user has access to, including their level of access in each one, you should use SharingUserRoutes.ListFoldersAsync. Likewise, make sure you implement SharingUserRoutes.ListFoldersContinueAsync too, as this interface is also paginated. Each returned SharedFolderMetadata will list the user's AccessType and Permissions.
Here's a little example:
var actionsToCheck = new Dropbox.Api.Sharing.FolderAction[] { Dropbox.Api.Sharing.FolderAction.EditContents.Instance, Dropbox.Api.Sharing.FolderAction.InviteEditor.Instance }; var list = await userClient.Sharing.ListFoldersAsync(actions: actionsToCheck); // actions can optionally be supplied to check the permissions the user has for specific actions foreach (var item in list.Entries) { Console.WriteLine(item.SharedFolderId); Console.WriteLine(item.PathLower); // only set if the folder is mounted Console.WriteLine(item.AccessType); Console.WriteLine(item.Permissions); } // and so on, iterating over pages from userClient.Sharing.ListFoldersContinueAsync if list.Cursor is set
Hope this helps!
Greg-DB
6 years agoDropbox Staff
[Cross-linking for reference: https://stackoverflow.com/questions/59272078/dropbox-api-how-to-see-each-team-members-folder-permissions#59272078 ]
When you list files and folders using FilesUserRoutes.ListFolderAsync like this, you're listing the contents of the member's Dropbox folder, which will include both shared folders (where they have some specific permission level) as well as their private folders (where they don't have a specific permission level, since it's just their folders). For shared folders, the returned FolderMetadata.SharingInfo will be set, but it doesn't contain information about that user's permission level in that folder. (By the way, make sure you implement ListFolderContinueAsync as well, to make sure you can retrieve all results, when using ListFolderAsync. Check out the ListFolderAsync documentation for more information.)
Instead, if you want to list the shared folders the user has access to, including their level of access in each one, you should use SharingUserRoutes.ListFoldersAsync. Likewise, make sure you implement SharingUserRoutes.ListFoldersContinueAsync too, as this interface is also paginated. Each returned SharedFolderMetadata will list the user's AccessType and Permissions.
Here's a little example:
var actionsToCheck = new Dropbox.Api.Sharing.FolderAction[] { Dropbox.Api.Sharing.FolderAction.EditContents.Instance, Dropbox.Api.Sharing.FolderAction.InviteEditor.Instance }; var list = await userClient.Sharing.ListFoldersAsync(actions: actionsToCheck); // actions can optionally be supplied to check the permissions the user has for specific actions foreach (var item in list.Entries) { Console.WriteLine(item.SharedFolderId); Console.WriteLine(item.PathLower); // only set if the folder is mounted Console.WriteLine(item.AccessType); Console.WriteLine(item.Permissions); } // and so on, iterating over pages from userClient.Sharing.ListFoldersContinueAsync if list.Cursor is set
Hope this helps!
- bmilinski6 years agoHelpful | Level 6
I appreciate the detailed response and time taken to answer the question. Thank you for the help!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 2 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!