Problema creazione nodo: Access denied

cancel
Showing results for 
Search instead for 
Did you mean: 
gaspare100
Member II

Problema creazione nodo: Access denied

Salve,
Sto cercando di creare un nodo che contiene un gruppo di metadati, questo nodo è di tipo custom, non è figlio di cm:content.
Questo è il codice relativo al content model:

        <type name="cdd:doc">
            <title>AIP</title>
            <parent>cm:content</parent>
            <properties>
                <property name="cdd:datachiusura">
                    <type>d:date</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="cdd:oggettodocumento">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
            </properties>
            <associations>
                <child-association name="cdd:soggettoproduttore">
                    <source>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>ppl:soggetto</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </child-association>
                <child-association name="cdd:destinatario">
                    <source>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>ppl:soggetto</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </child-association>
            </associations>
        </type>

        <!– Definition of new Content Type: Soggetto –>
        <type name="ppl:soggetto">
            <title>Soggetto</title>
            <properties>
                <property name="ppl:nome">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="ppl:cognome">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="ppl:codicefiscale">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
            </properties>
        </type>

Questo il codice relativo alla creazione del nodo:

                ChildAssociationRef assocNode = nodeService.createNode(
                        actionedUponNodeRef,
                        QName.createQName(
                                association.getAttribute("namespace"),
                                association.getAttribute("nome")),
                        QName.createQName(
                                NamespaceService.CONTENT_MODEL_PREFIX,
                                association.getAttribute("nome")),
                        QName.createQName(
                                association.getAttribute("namespaceNodo"),
                                association.getAttribute("nomeNodo")),props);
                List<NodeRef> targets = new ArrayList<NodeRef>();
                targets.add(assocNode.getChildRef());
                nodeService.setAssociations(actionedUponNodeRef, QName.createQName(
                        association.getAttribute("namespace"),
                        association.getAttribute("nome")), targets);

ho provato anche a togliere questa parte
targets.add(assocNode.getChildRef());
                nodeService.setAssociations(actionedUponNodeRef, QName.createQName(
                        association.getAttribute("namespace"),
                        association.getAttribute("nome")), targets);

ma in ogni caso ottengo questo errore
<cite>2014-04-14 16:43:58,001  ERROR [extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-9] Exception from executeScript - redirecting to status template error: 03140014 Access Denied.  You do not have the appropriate permissions to perform this operation.
org.alfresco.repo.security.permissions.AccessDeniedException: 03140014 Access Denied.  You do not have the appropriate permissions to perform this operation.
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:50)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:161)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
   at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at com.sun.proxy.$Proxy20.getProperties(Unknown Source)
   at it.libersoft.action.executer.PdVFileValidator.addMetadataToFile(PdVFileValidator.java:250)
   at it.libersoft.action.executer.PdVFileValidator.executeImpl(PdVFileValidator.java:144)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:258)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:838)
   at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:66)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:258)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:838)
   at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:738)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:572)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:161)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at com.sun.proxy.$Proxy52.executeAction(Unknown Source)
   at org.alfresco.repo.rule.RuleServiceImpl.executeAction(RuleServiceImpl.java:1250)
   at org.alfresco.repo.rule.RuleServiceImpl.executeRule(RuleServiceImpl.java:1244)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:1190)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:1119)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:1092)
   at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:57)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:737)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:717)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:683)
   at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:927)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:737)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:472)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:474)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:744)
Caused by: net.sf.acegisecurity.AccessDeniedException: Access is denied.
   at net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:86)
   at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:398)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   … 77 more
</cite>
come mai?
3 Replies
davidciamberlan
Alfresco Employee

Re: Problema creazione nodo: Access denied

Ciao,

scusa la domanda scontata: l'utente con cui stai operando ha i permessi corretti per eseguire tutte le operazioni che stai eseguendo?

Dai log sembra quello il problema…
gaspare100
Member II

Re: Problema creazione nodo: Access denied

l'utente è admin, l'azione parte inserendo un file in una cartella creata dallo stesso utente. Il file deve poi essere validato  (hash).
Dopo la validazione devo inserire i metadati conservati precedentemente in un altro file, e questo funziona, riesco a cambiare il tipo al file e aggiungere i metadati.
Non riesco però a creare un nuovo nodo di tipo soggetto e associarlo al file appena ricevuto (actionedUponNodeRef) a causa di questo errore. Faccio notare anche che ho provato a creare il nodo soggetto ma non aggiungere l'associazione. In questo caso se ricerco il nodo creato tramite noderef incontro lo stesso errore (access denied) anche tramite node browser di share.
gaspare100
Member II

Re: Problema creazione nodo: Access denied

Risolto, il problema stava nei permessi ovviamente… pensavo admin avesse accesso a tutto di default, ma non è così se non si eredita da sys:base. Ora funziona, grazie Smiley Happy