POST 拒绝 - 露天

POST refused - Alfresco

我正在制作 POST 内部工作流程,但如果我使用管理员登录,则会制作 post。

但是,如果我用另一个用户的另一个登录创建一个 post,我会得到这个错误:

{
    "status" :    {
    "code" : 403,
    "name" : "Forbidden",
    "description" : "Server understood the request but refused to fulfill it."   },  
     "message" : "01070001 org.alfresco.repo.security.permissions.AccessDeniedException: 01070015 Access  Denied.  You do not have the appropriate permissions to perform this operation.",     "exception" : "org.springframework.extensions.webscripts.WebScriptException - 01070001 org.alfresco .repo.security.permissions.AccessDeniedException: 01070015 Access Denied.  You do not have the appropriate  permissions to perform this operation.",
     "callstack" :    [ 
      ""      ,"net.sf.acegisecurity.AccessDeniedException: Access is denied."
      (....)
      ,"java.lang.Thread.run(Thread.java:745)"
      ,"org.alfresco.repo.security.permissions.AccessDeniedException: 01070015 Access Denied.  You do  not have the appropriate permissions to perform this operation."

      ,"org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor .java:50)"
      ,"org.springframework.extensions.webscripts.WebScriptException: 01070001 org.alfresco.repo.security .permissions.AccessDeniedException: 01070015 Access Denied.  You do not have the appropriate permissions  to perform this operation."
      ,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript .java:1112)"
    ],
     "server" : "Community v5.0.0 (d r99759-b2) schema 8,022",   "time" : "Feb 7, 2016 3:03:39 PM" }

你能帮帮我吗?

我的post:

    var base64str = pdfbase64;
    var binary = atob(base64str.replace(/\s/g, ''));
    var len = binary.length;
    var buffer = new ArrayBuffer(len);
    var view = new Uint8Array(buffer);
    for (var i = 0; i < len; i++) {
        view[i] = binary.charCodeAt(i);
    }
    var blob = new Blob( [view], { type: "application/pdf" });
    var fd = new FormData();
    if (Alfresco.util.CSRFPolicy && Alfresco.util.CSRFPolicy.isFilterEnabled())
    {
        url = url + "?" + Alfresco.util.CSRFPolicy.getParameter() + "=" + encodeURIComponent(Alfresco.util.CSRFPolicy.getToken());
    }
    fd.append("updatenoderef", nodeRef);
    fd.append("filedata", blob);
    fd.append("majorversion", "true");
    fd.append("overwrite", "true");

    var request = new XMLHttpRequest();
    request.open("POST", url);
    request.send(fd);

如果 he/she 对 Alfresco 中的节点具有写入权限,则任何用户都可以更新文档。

它与管理员一起工作,因为管理员对 Alfresco 中的任何节点都有写入权限。

你没有写你正在调用的webscript的url,但我认为这是要上传的脚本。您需要确保用户具有在该节点上写入的权限。 这个节点存储在哪里?它是一个共享站点吗?如果是,该用户是否已被邀请访问该网站以及扮演什么角色? 共享站点的角色是:

Managers have full rights to all site content - what they have created themselves and what other site members have created.

Collaborators have full rights to the site content that they own; they have rights to edit but not delete content created by other site members.

Contributors have full rights to the site content that they own; they cannot edit or delete content created by other site members.

Consumers have view-only rights in a site: they cannot create their own content.

请注意,如果文件是由其他人创建的,用户只能使用 "Collaborator" 角色修改它。

更新: 如果管理员创建了文档,则该文档将可由协作者修改。这是默认行为,您无需执行任何操作。

如果您希望贡献者也可以修改文档,您可以在站点级别或文档级别提供 "collaborator permissions" 到 "contributors"。在文档或父文件夹上使用 "Manage Permissions" 来更改此权限。 这适用于网站。

如果文档不在站点中,您必须使用组并将协作者权限分配给应该能够更改文档的组。