你能建议吗?
我试图以编程方式在OneDrive,OneDrive for Business,SharePoint Online中插入文件权限,这与您在Google Cloud 端硬盘上的操作方式不同 .
即:https://developers.google.com/drive/v2/reference/permissions/insert
我找不到用于插入文件权限的OneDrive API范围/方法? (实际上以编程方式共享文件) . 有没有人碰巧知道这是否可能,如果有的话,使用哪个范围/方法?我假设它的东西,如SetPermission?
我知道您可以通过OneDrive API中的'wl.skydrive'范围获得链接,但不清楚是否添加了任何权限?
先感谢您
詹姆士
2 回答
最接近的模拟是共享编辑和共享读取链接:
http://msdn.microsoft.com/en-us/library/dn631815.aspx#get_links_to_files_and_folders
如果您正在构建SharePoint应用程序,则可能需要尝试使用SPRoleAssignment类,该类可能也适用于OneDrive for Business:http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.sproleassignment(v=office.15).aspx
基本上,您创建一个组,添加权限级别,然后将其分配给项目 .
您还可以使用DocumentSharingManager类中的UpdateDocumentSharingInfo方法(http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.sharing.documentsharingmanager.updatedocumentsharinginfo(v=office.15).aspx)在OneDrive for Business中共享内部文件 . 以下是如何拨打电话:
DocumentSharingManager.UpdateDocumentSharingInfo(_ctx,_resourceURL,new List(),validateExistingPermissions:true,additiveMode:true,sendServerManagedNotification:false,customMessage:null,includeAnonymousLinksInNotification:false); _ctx.ExecuteQuery();