cancel
Showing results for 
Search instead for 
Did you mean: 

access rights weirdness

kbryd
Champ in-the-making
Champ in-the-making
Hello

I have a following situation:

* there is a file in Company Home, uploaded by the admin user but other users with other privileges can view and edit it's properties using the WebClient
* using Foundation client I am unable to do the same, following code does not work for the same document:


        NodeRef invId  = new NodeRef(storeRef, "1e1d5c84-8e06-436c-8a4d-12fc48afe792");
        System.out.println(nodeService.getProperty(invId, ContentModel.PROP_NAME));

I get following exception:

Exception in thread "main" org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied.  You do not have the appropriate permissions to perform this operation.
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:245)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy3.getProperty(Unknown Source)
        at org.alfresco.sample.FirstFoundationClient.doExample(FirstFoundationClient.java:141)
        at org.alfresco.sample.FirstFoundationClient$1.execute(FirstFoundationClient.java:77)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:294)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:209)
        at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:81)
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:394)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        … 13 more



Above code was run from the same user account: both from SDK and from Webclient and results are different, why?
1 REPLY 1

kbryd
Champ in-the-making
Champ in-the-making
As usually I will reply myself Smiley Happy

Problem was not with the code but with the configuration. All SDK examples use some default configuration which is in config.jar (and some folder in AlfrescoSDK), what I did was replacing that default configuration with the one I use in the Webclient - and it works now….However, I would really want to know why it doesn't work with the default configuration? Looking at the stacktrace it seems that it has something to do with audit, but audit was disabled even in that SDK configuration, so what else can be causing that problem?

K.