Create Folder issues

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 03:34 AM
I have a weird issue… if someone could explain to me why this would happen. This is an Alfresco 3.2r1 release.
I have a script that creates a folder. If I create the folder as follows, it works fine:
acc_node = space.parent.createFolder(idtituadrl);
However, if I do script it as such (which I ultimately want to do, it fails with an Access denied error:
acc_node = space.parent.createNode("" + idtituadrl, "bibo:bo_folder", props);
Same user, same everything. Just that one line changes. Using the hasPermissions("CreateChildren") and ("Write"), both return true.
09:28:28,845 DEBUG [repo.jscript.ScriptLogger] Permission create children: true09:28:28,845 DEBUG [repo.jscript.ScriptLogger] Permission Write: true09:28:28,918 ERROR [repo.action.AsynchronousActionExecutionQueueImpl] Failed to execute asynchronous action: Action[ id=1d25bcfc-db28-43e0-a130-cff0b6e6d5b7, node=workspace://SpacesStore/1d25bcfc-db28-43e0-a130-cff0b6e6d5b7 ]org.alfresco.scripts.ScriptException: 04170020 Failed to execute script 'workspace://SpacesStore/403ab5be-b0ec-40da-b62c-d1c67a6568ca': 04170019 Access Denied. You do not have the appropriate permissions to perform this operation. at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:228) at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy205.executeScript(Unknown Source) at org.alfresco.repo.action.executer.ScriptActionExecuter.executeImpl(ScriptActionExecuter.java:170) at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127) at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:711) at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:72) at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127) at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:711) at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:648) at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1$1.execute(AsynchronousActionExecutionQueueImpl.java:369) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:233) at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:378) at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:503) at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:381) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)Caused by: org.alfresco.repo.security.permissions.AccessDeniedException: 04170019 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:171) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.moveNode(Unknown Source) at org.alfresco.repo.jscript.ScriptNode.move(ScriptNode.java:1592) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66) at org.mozilla.javascript.gen.c14._c0(workspace://SpacesStore/403ab5be-b0ec-40da-b62c-d1c67a6568ca:136) at org.mozilla.javascript.gen.c14.call(workspace://SpacesStore/403ab5be-b0ec-40da-b62c-d1c67a6568ca) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834) at org.mozilla.javascript.gen.c14.call(workspace://SpacesStore/403ab5be-b0ec-40da-b62c-d1c67a6568ca) at org.mozilla.javascript.gen.c14.exec(workspace://SpacesStore/403ab5be-b0ec-40da-b62c-d1c67a6568ca) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:457) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:224) … 34 moreCaused 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:171) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49) … 57 more
Any ideas? Thanks a lot.
fred
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 03:51 AM
I think there's a difference between how to create a cm:folder and how you want to create your bibo:bo_folder…
Maybe you have defined special permission when you create your custom folder…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 03:54 AM
<types> <type name="bibo:bo_folder"> <title>BO folder</title> <properties> <property name="bibo:account_number"> <type>d:text</type> <mandatory>false</mandatory> </property> <property name="bibo:cli_name"> <type>d:text</type> <mandatory>false</mandatory> </property> </properties> </type> </types>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 03:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:09 AM
For you, this is a new type. There are no default link between your custom type and default alfresco permission…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:29 AM
Except if you have special right or permission in your parent folder…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 04:32 AM
If you stumble into something, please let me know. Thanks already for your time and help.
I'll post an update if I do find something.
fred
