<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get each team member's permissions per folder using .NET Dropbox API? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383460#M21340</link>
    <description>&lt;P&gt;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 writing in C# as seen in my code:&lt;/P&gt;
&lt;PRE&gt; public MainPage()
        {
            this.InitializeComponent();
            var task = Task.Run((Func&amp;lt;Task&amp;gt;)MainPage.Run);
            task.Wait();
        }

        //Async task to
        static async Task Run()
        {
            
            //use dropbox client with access token from app console
            using (DropboxTeamClient DBTeamClient = new DropboxTeamClient("MYACCESSKEY"))
            {
                //get all the dropbox members
                var members = await DBTeamClient.Team.MembersListAsync();
                //loop through all members ordered by email alphabetical             
                foreach (var member in members.Members.OrderBy(a =&amp;gt; a.Profile.Email))
                {
                    //get each user
                    var userClient = DBTeamClient.AsMember(member.Profile.TeamMemberId);
                    //get each user's file information
                    var list = await userClient.Files.ListFolderAsync(string.Empty);                   
                    //loop through the list of file and show permissions on folders
                    foreach (var item in list.Entries.OrderBy(b =&amp;gt; b.PathDisplay))
                    {
                        //only display folder information
                        if (item.IsFolder)
                        {
                           //get folder permissions here??
                        }
                    }
                }
            }
        }&lt;/PRE&gt;
&lt;P&gt;I'd appreciate more of an explanation or example rather than a link to API documentation (as they contain no implementation examples so are not much help).&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 20:13:18 GMT</pubDate>
    <dc:creator>bmilinski</dc:creator>
    <dc:date>2019-12-10T20:13:18Z</dc:date>
    <item>
      <title>How to get each team member's permissions per folder using .NET Dropbox API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383460#M21340</link>
      <description>&lt;P&gt;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 writing in C# as seen in my code:&lt;/P&gt;
&lt;PRE&gt; public MainPage()
        {
            this.InitializeComponent();
            var task = Task.Run((Func&amp;lt;Task&amp;gt;)MainPage.Run);
            task.Wait();
        }

        //Async task to
        static async Task Run()
        {
            
            //use dropbox client with access token from app console
            using (DropboxTeamClient DBTeamClient = new DropboxTeamClient("MYACCESSKEY"))
            {
                //get all the dropbox members
                var members = await DBTeamClient.Team.MembersListAsync();
                //loop through all members ordered by email alphabetical             
                foreach (var member in members.Members.OrderBy(a =&amp;gt; a.Profile.Email))
                {
                    //get each user
                    var userClient = DBTeamClient.AsMember(member.Profile.TeamMemberId);
                    //get each user's file information
                    var list = await userClient.Files.ListFolderAsync(string.Empty);                   
                    //loop through the list of file and show permissions on folders
                    foreach (var item in list.Entries.OrderBy(b =&amp;gt; b.PathDisplay))
                    {
                        //only display folder information
                        if (item.IsFolder)
                        {
                           //get folder permissions here??
                        }
                    }
                }
            }
        }&lt;/PRE&gt;
&lt;P&gt;I'd appreciate more of an explanation or example rather than a link to API documentation (as they contain no implementation examples so are not much help).&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 20:13:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383460#M21340</guid>
      <dc:creator>bmilinski</dc:creator>
      <dc:date>2019-12-10T20:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get each team member's permissions per folder using .NET Dropbox API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383467#M21341</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/59272078/dropbox-api-how-to-see-each-team-members-folder-permissions#59272078" target="_blank"&gt;https://stackoverflow.com/questions/59272078/dropbox-api-how-to-see-each-team-members-folder-permissions#59272078&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;When you list files and folders using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;FilesUserRoutes.ListFolderAsync&lt;/A&gt; like this, you're listing the contents of the member's&amp;nbsp;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&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_FolderMetadata_SharingInfo.htm" target="_self"&gt;FolderMetadata.SharingInfo&lt;/A&gt; 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&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderContinueAsync.htm" target="_self"&gt;ListFolderContinueAsync&lt;/A&gt; as well, to make sure you can retrieve all results, when using&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt;. Check out the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt;&amp;nbsp;documentation for more information.)&lt;/P&gt;
&lt;P&gt;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&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersAsync_1.htm" target="_self"&gt;SharingUserRoutes.ListFoldersAsync&lt;/A&gt;. Likewise, make sure you implement&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersContinueAsync_1.htm" target="_self"&gt;SharingUserRoutes.ListFoldersContinueAsync&lt;/A&gt; too, as this interface is&amp;nbsp;also paginated. Each returned&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Sharing_SharedFolderMetadata.htm" target="_self"&gt;SharedFolderMetadata&lt;/A&gt; will list the user's&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_SharedFolderMetadataBase_AccessType.htm" target="_self"&gt;AccessType&lt;/A&gt; and&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_SharedFolderMetadata_Permissions.htm" target="_self"&gt;Permissions&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here's a little example:&lt;/P&gt;
&lt;PRE&gt;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&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 20:08:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383467#M21341</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-12-10T20:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get each team member's permissions per folder using .NET Dropbox API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383472#M21342</link>
      <description>&lt;P&gt;I appreciate the detailed response and time taken to answer the question. Thank you for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 20:15:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-each-team-member-s-permissions-per-folder-using-NET/m-p/383472#M21342</guid>
      <dc:creator>bmilinski</dc:creator>
      <dc:date>2019-12-10T20:15:22Z</dc:date>
    </item>
  </channel>
</rss>

