OneDrive API - Shareporint online权限

时间:2016-11-11 03:41:34

标签: sharepoint onedrive

权限端点https://dev.onedrive.com/resources/permission.htm也应该返回用户的角色。对于一个驱动器文件夹,它工作正常。

但是当对共享点文档库/文件夹使用它时,除了所有者之外,没有为共享库/站点/文件夹的其他用户返回角色。

示例权限调用,

https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w5f-XJRCqSESr32g08dO6nF/root:/%2F:/permissions

输出,(如您所见,大多数权限都没有提供角色)。这是已知的限制,任何为用户/组获取共享点角色的想法,例如“完全控制”,“设计”和“#39;设计'通过一个驱动器api获得sharepoint资源。感谢。

{
"@odata.context":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/$metadata#permissions",
   "value":[
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNjMzNjg2Ng",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNjMzNjg2Ng",
         "grantedTo":{
            "user":{
               "displayName":"c:0-.f|rolemanager|s-1-5-21-4057271854-771539223-3591658312-6336866"
            }
         },
         "id":"YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNjMzNjg2Ng",
         "roles":[
            "write"
         ]
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNDIzNDYwNw",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNDIzNDYwNw",
         "grantedTo":{
            "user":{
               "displayName":"Company Administrator"
            }
         },
         "id":"YzowLS5mfHJvbGVtYW5hZ2VyfHMtMS01LTIxLTQwNTcyNzE4NTQtNzcxNTM5MjIzLTM1OTE2NTgzMTItNDIzNDYwNw",
         "roles":[
            "write"
         ]
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8Ym9vYm9vc2FpX291dGxvb2suY29tI2V4dCNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8Ym9vYm9vc2FpX291dGxvb2suY29tI2V4dCNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "grantedTo":{
            "user":{
               "id":"11a04758-0129-4c1f-b946-bf159642294e",
               "displayName":"booboosai@outlook.com"
            }
         },
         "id":"aTowIy5mfG1lbWJlcnNoaXB8Ym9vYm9vc2FpX291dGxvb2suY29tI2V4dCNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20"
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjFAdmVyYWRvY3MuY29t",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjFAdmVyYWRvY3MuY29t",
         "grantedTo":{
            "user":{
               "id":"54f584b5-6627-4137-93f2-a93829a5a750",
               "displayName":"Dev 1 Admin"
            }
         },
         "id":"aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjFAdmVyYWRvY3MuY29t"
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjJAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjJAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "grantedTo":{
            "user":{
               "id":"b49ac078-e9e5-4f39-b1ae-22fd7cc4018b",
               "displayName":"Dev 2 User"
            }
         },
         "id":"aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjJAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20"
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20",
         "grantedTo":{
            "user":{
               "id":"a6748562-1bbe-436d-ab3a-ac9ff41a80c6",
               "displayName":"Dev 3 User"
            }
         },
         "id":"aTowIy5mfG1lbWJlcnNoaXB8ZW5ndXNlcjNAdmVyYWVuZ2Vudi5vbm1pY3Jvc29mdC5jb20"
      },
      {
         "@odata.type":"#oneDrive.permission",
         "@odata.id":"https://veraengenv.sharepoint.com/SarvaTestSite/_api/v2.0/drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8c2FyYXZhLWFkbWluQHZlcmFlbmdlbnYub25taWNyb3NvZnQuY29t",
         "@odata.editLink":"drives/b!vZn4gvPZgEGfRWFQYbih6mFCzVktIRBNhZu_RwyO_w6wxB2Rrk8mRbLphnvO21K7/items/01FNR6N36IKZB5VPZ62FAJUOJRMKC4O4KL/permissions/aTowIy5mfG1lbWJlcnNoaXB8c2FyYXZhLWFkbWluQHZlcmFlbmdlbnYub25taWNyb3NvZnQuY29t",
         "grantedTo":{
            "user":{
               "id":"1e3b97eb-0d8e-438e-af34-6873a92a37bb",
               "displayName":"Saravanan Admin"
            }
         },
         "id":"aTowIy5mfG1lbWJlcnNoaXB8c2FyYXZhLWFkbWluQHZlcmFlbmdlbnYub25taWNyb3NvZnQuY29t"
      }
   ]
}

1 个答案:

答案 0 :(得分:4)

你在这里问了两个问题。

1)响应中未显示的角色是OneDrive API对业务帐户的已知限制。我们正在推出一个修复程序,它应该很快就可供所有呼叫者使用。

2)如果共享操作使用简化角色('view','edit'),OneDrive API将返回'读/写'角色。默认情况下,新的OneDrive共享对话框仅允许您从这些简化角色中进行选择。但是,如果通过高级(旧版)共享工作流进行共享操作,则OneDrive API将返回相应的角色(“完全控制”,“设计”等)。 您可以尝试使用高级共享工作流程进行共享,如下所示:

  • 点击您要分享的项目旁边的省略号(...)
  • 点击“详细信息”
  • 选项
  • 点击“详细信息”后,展开左侧打开的导航窗格中的“共享”下拉列表。
  • 点击“高级”。

现在尝试使用OneDrive permissions API,响应应包含高级角色,前缀为SP,例如: 'SP.Design'。