我正在工作流中发布 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" }
你能帮助我吗?
我的帖子:
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);