简体   繁体   English

共享文件 API 列出所有有权访问文件夹的用户

[英]Sharefile API List all Users with access to Folder

With the Sharefile API, is there a way to list all users who have access to a certain folder given a folder ID?使用 Sharefile API,有没有办法列出所有有权访问给定文件夹 ID 的特定文件夹的用户? Or given a user ID, is there a way to list the folders they have access to?或者给定一个用户 ID,有没有办法列出他们有权访问的文件夹?

This should get you the list of users that have access to some folderId (this is with the C# SDK, other SDKs should be similar):这应该为您提供有权访问某些folderId的用户列表(这是 C# SDK,其他 SDK 应该类似):

string folderId;
ShareFileClient client;
...
var acls = await client.AccessControls.GetByItem(client.Items.GetEntityUriFromId(folderId)).ExecuteAsync();
foreach (var acl in acls.Feed)
{
    var user = acl.Principal;
    ...
}

I don't think the inverse is possible (getting a list of folders a particular user has access to).我认为反过来是不可能的(获取特定用户有权访问的文件夹列表)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM