功能描述
用于初始化角色权限。
接口说明
要求权限:系统管理员(admin)权限。
该接口只能初始化一次,成功后无法再次初始化。
建议使用 Demo 中的请求体直接初始化,如需定制化,则可修改对应参数。
请求体中只能有一个所有者权限,即:isOwner = true。
请求
请求示例
POST /api/v1/authority/{LibraryId}/init-role-list?access_token={AccessToken}
请求参数:
LibraryId:媒体库 ID,必选参数。
AccessToken:访问令牌,必选参数。
请求体
application/json
[{"name": "观察者","canView": true,"canPreview": false,"canDownload": false,"canUpload": false,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": false,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表","isDefault": true,"isOwner": false},{"name": "预览者","canView": true,"canPreview": true,"canDownload": false,"canUpload": false,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": false,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览","isDefault": false,"isOwner": false},{"name": "下载者","canView": true,"canPreview": true,"canDownload": true,"canUpload": false,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": true,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览、下载、分享","isDefault": false,"isOwner": false},{"name": "上传者","canView": true,"canPreview": false,"canDownload": false,"canUpload": true,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": false,"canPreviewSelf": true,"canDownloadSelf": true,"roleDesc": "查看列表、预览(仅自己)、下载(仅自己)、上传","isDefault": false,"isOwner": false},{"name": "传输者","canView": true,"canPreview": true,"canDownload": true,"canUpload": true,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": false,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览、下载、上传","isDefault": false,"isOwner": false},{"name": "编辑者","canView": true,"canPreview": true,"canDownload": true,"canUpload": true,"canDelete": true,"canModify": true,"canAuthorize": false,"canShare": true,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览、下载、上传、删除、修改、分享","isDefault": false,"isOwner": false},{"name": "操作者","canView": true,"canPreview": true,"canDownload": true,"canUpload": true,"canDelete": true,"canModify": true,"canAuthorize": true,"canShare": true,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览、下载、上传、删除、修改、共享、分享","isDefault": false,"isOwner": false},{"name": "所有者","canView": false,"canPreview": false,"canDownload": false,"canUpload": false,"canDelete": false,"canModify": false,"canAuthorize": false,"canShare": false,"canPreviewSelf": false,"canDownloadSelf": false,"roleDesc": "查看列表、预览、下载、上传、删除、修改、共享、分享","isDefault": false,"isOwner": true}]
响应
响应码
初始化成功,返回 HTTP 204 No Content。
响应体
无。