我正在尝试使用路径获取用户的文件权限列表(电子邮件 ID 名称等),还尝试使用文件 ID,但它显示了成员、所有者和访问者的数组。我想检查有多少用户可以访问该特定文件,并且我想删除或更新特定用户/用户的权限。您可以在下面的屏幕截图中看到我的代码和响应。
代码
$data = $graph->createRequest('GET', '/sites/0ae7cea9-8064-4e26-820d-839030aa60f9/drive/root:/SafeJournal/Borgere/Rasmus Sørensen/ali.docx:/permissions')
->setReturnType(Model\User::class)
->execute();
回复
Array
(
[0] => Microsoft\Graph\Model\User Object
(
[_propDict:protected] => Array
(
[id] => Vm9yZGluZ2JvcmcgT3duZXJz
[roles] => Array
(
[0] => owner
)
[grantedTo] => Array
(
[user] => Array
(
[displayName] => Vordingborg Owners
)
)
[inheritedFrom] => Array
(
)
)
)
[1] => Microsoft\Graph\Model\User Object
(
[_propDict:protected] => Array
(
[id] => Vm9yZGluZ2JvcmcgVmlzaXRvcnM
[roles] => Array
(
[0] => read
)
[grantedTo] => Array
(
[user] => Array
(
[displayName] => Vordingborg Visitors
)
)
[inheritedFrom] => Array
(
)
)
)
[2] => Microsoft\Graph\Model\User Object
(
[_propDict:protected] => Array
(
[id] => Vm9yZGluZ2JvcmcgTWVtYmVycw
[roles] => Array
(
[0] => write
)
[grantedTo] => Array
(
[user] => Array
(
[displayName] => Vordingborg Members
)
)
[inheritedFrom] => Array
(
)
)
)
[3] => Microsoft\Graph\Model\User Object
(
[_propDict:protected] => Array
(
[id] => Yzowby5jfGZlZGVyYXRlZGRpcmVjdG9yeWNsYWltcHJvdmlkZXJ8MzRjOTg0ODItMDE0OS00ZDdmLTk4NzUtNzNjMzQwNDdiMGRkX28
[roles] => Array
(
[0] => owner
)
[grantedTo] => Array
(
[user] => Array
(
[email] => Vordingborg@appvelo.onmicrosoft.com
[id] => 34c98482-0149-4d7f-9875-73c34047b0dd
[displayName] => Vordingborg Owners
)
)
[inheritedFrom] => Array
(
)
)
)
)