I am trying to retrieve the parent folder of the current folder I am in to make it easier to trace permissions amongst folders. I currently am able to list every user's folder, permissions, etc., but is there anyway to use the "item" variable in the code below to directly access its parent folder's name?
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 => a.Profile.Email))
{
int count = 0;
//get each user
var userClient = DBTeamClient.AsMember(member.Profile.TeamMemberId);
//actions to check
var actionsToCheck = new FolderAction[] { FolderAction.EditContents.Instance, FolderAction.InviteEditor.Instance };
//get each user's file information
var list = await userClient.Sharing.ListFoldersAsync(actions: actionsToCheck); // actions can optionally be supplied to check the permissions the user has for specific actions
//loop through the list of file and show permissions on folders
foreach (var item in list.Entries)
{
int length = item.AccessType.ToString().Length - 32 - 2;
System.Diagnostics.Debug.WriteLine("");
System.Diagnostics.Debug.WriteLine(member.Profile.Name.DisplayName);
System.Diagnostics.Debug.WriteLine(item.Name);
System.Diagnostics.Debug.WriteLine(item.AccessType.ToString().Substring(32, length));
System.Diagnostics.Debug.WriteLine(count + "");
count++;
}
System.Diagnostics.Debug.WriteLine(count + " total folders");
}
}
Thanks in advance!
EDIT: I noticed item contains a "ParentSharedFolderId" member, but how can I use this to find the name of the parent?