AnsweredAssumed Answered

Possible bug while checking in via REST API?

Question asked by n4zroth on Sep 21, 2015
Latest reply on Oct 8, 2015 by resplin
Hi,
I'm trying to check in a document via REST-Api and I always get the error that I don't have the appropriate permissions to perform the operation. Problem is that the checkin actually completes.
Application flow is the following:
Checkout via service/slingshot/doclib/action/checkout/node/
Upload of new content via service/api/upload/ to the previously created working copy
Checkin via service/slingshot/doclib/action/checkin/node/
This correctly locks and unlocks the document and updates its content even though the server returns a 500 - Internal Error.
This occurs even with an administrator ticket.
Any idea why I get the 'Access Denied'?
Callstack, if it helps:
""      ,"net.sf.acegisecurity.AccessDeniedException: Access is denied."
      ,"net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:86)"
      ,"net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:398)"
      ,"net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
      ,"org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
      ,"org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
      ,"org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)"
      ,"org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)"
      ,"org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)"
      ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
      ,"com.sun.proxy.$Proxy80.checkin(Unknown Source)"
      ,"org.alfresco.repo.jscript.ScriptNode.checkin(ScriptNode.java:2493)"
      ,"org.alfresco.repo.jscript.ScriptNode.checkin(ScriptNode.java:2461)"
      ,"sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"
      ,"sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
      ,"java.lang.reflect.Method.invoke(Method.java:483)"
      ,"org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)"
      ,"org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)"
      ,"org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:85)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_runAction_19(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:889)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
      ,"org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_main_13(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:607)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
      ,"org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4._c_script_0(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js:920)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
      ,"org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)"
      ,"org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.call(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
      ,"org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_slingshot_documentlibrary_action_checkin_post_json_js_4.exec(classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/action\/checkin.post.json.js)"
      ,"org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:502)"
      ,"org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:200)"
      ,"org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)"
      ,"org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)"
      ,"org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)"
      ,"org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1364)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:489)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
      ,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:727)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)"
      ,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)"
      ,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)"
      ,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)"
      ,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)"
      ,"org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2403)"
      ,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)"
      ,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)"
      ,"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)"
      ,"java.lang.Thread.run(Thread.java:745)"
      ,"org.alfresco.repo.security.permissions.AccessDeniedException: 08210048 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: 08210014 JavaException: org.alfresco.repo.security.permissions.AccessDeniedException: 08210048 Access Denied.  You do not have the appropriate permissions to perform this operation."
      ,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1112)"

Thanks

Outcomes