我使用rest API将许多文件上传到Nuxeo服务器。现在,我需要向用户添加权限。我将http://localhost:8080/nuxeo/api/v1/id/file-id/@acl
端点与有效负载一起使用:
{
"username": "username",
"permission": "ReadWrite"
}
但是它不起作用。错误是:
{
"entity-type": "exception",
"status": 405,
"message": "javax.ws.rs.WebApplicationException"
}
我该怎么办?是否有任何端点?
可以通过http://localhost:8080/nuxeo/api/v1/automation/Document.AddPermission端点上可用的Document.AddPermission操作添加权限。
这里是一个卷曲示例调用,用于将editor用户的ReadWrite权限添加到ID为[[2d28e87f-0753-4cfc-9f9b-b17d424aa6a7的文档中:]]curl -X POST -u Administrator:Administrator \
http://localhost:8080/nuxeo/api/v1/automation/Document.AddPermission \
-H "Content-Type: application/json" \
-d '{"params":{"users":["editor"],"permission":"ReadWrite"},"input":"2d28e87f-0753-4cfc-9f9b-b17d424aa6a7"}'
这是您要为外部用户添加权限时的有效负载示例:
{
"params": {
"users":[],
"email": "[email protected]",
"permission": "Read",
"begin": "2020-06-01T00:00:00+02:00",
"end": "2020-06-30T00:00:00+02:00",
"notify": true,
"comment": "[email protected]"},
"context": {},
"input": "2d28e87f-0753-4cfc-9f9b-b17d424aa6a7"
}