cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco search doesn't work with a specify group

julian
Champ in-the-making
Champ in-the-making
Hi,
I have 2 groups which are added in the list of groups of the site (/share/page/site/library/site-groups) containing folders and documents I want searched.
The 2 groups are the same with a different name.

My site (allow group1 and group2 )
|_doc1.pdf
|_doc2.pdf

When I make a search (like doc1) with a person in the first group, I have all results I want. But if I search with a person of the second group it doesn't work.

I have this error:


2013-06-05 23:56:45,963 ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-11] Exception from executeScript - redirecting to status template error: 05050002 Wrapped Exception (with status template): 05050071 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05050070 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
org.springframework.extensions.webscripts.WebScriptException: 05050002 Wrapped Exception (with status template): 05050071 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05050070 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:422)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:433)
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:345)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
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:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
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:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.alfresco.scripts.ScriptException: 05050071 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 05050070 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:202)
at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1305)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
… 28 more
Caused by: org.alfresco.repo.security.permissions.AccessDeniedException: 05050070 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
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:159)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:69)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:433)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy7.getPath(Unknown Source)
at org.alfresco.repo.jscript.ScriptNode.getQnamePath(ScriptNode.java:1159)
at sun.reflect.GeneratedMethodAccessor640.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
at org.mozilla.javascript.JavaMembers.get(JavaMembers.java:117)
at org.mozilla.javascript.NativeJavaObject.get(NativeJavaObject.java:113)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1544)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1375)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1364)
at org.mozilla.javascript.gen.c30._c13(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:522)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c30._c14(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:585)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c30._c20(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1021)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c30._c22(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1057)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
at org.mozilla.javascript.gen.c30._c0(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js:1060)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at org.mozilla.javascript.gen.c30.call(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.mozilla.javascript.gen.c30.exec(file:/opt/alfresco-4.2.b/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.get.js)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:492)
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:198)
… 33 more
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)


If somebody has an idea why the second group is not allowed, it will be a big help. Index?

Thanks in advance
3 REPLIES 3

patil
Champ on-the-rise
Champ on-the-rise
It is to do with the permissions.
Caused by: net.sf.acegisecurity.AccessDeniedException: Access is denied.

Invite that group as site Manager then try searching.

Thanks,
Patil
Cignex Datamatics

julian
Champ in-the-making
Champ in-the-making
in fact it's not a problem that the group not belong to site Manager. The documents that cause problem are moved by a custom Alfresco action (coded in java). If the file has a specific type we removed permissions for group 2 on it (like this, the document is not visible for group 2 in the destination folder). If in the java action I keep the permissions on this node for group 2, the search works.

In the java action I removed the permissions like this:
<blockcode>
permissionService.setPermission(node, "GROUP_group2", PermissionService.READ, false);
</blockcode>

This code works well because I don't see the node when I am in group2 and I look the destination folder. But the search is in error when it finds this node.

Have you an idea?

Thanks

julian
Champ in-the-making
Champ in-the-making
I found a way to do this:
For the folder and the document I don't want to be show to the group2, I implemented the following java action code:
<blockcode>
permissionService.setInheritParentPermissions(folderNode, false);
permissionService.setPermission(folderNode, "GROUP_group2", PermissionService.EXECUTE, false);
permissionService.setPermission(folderNode, "GROUP_group2", PermissionService.READ, false);
</blockcode>
And for the document:
<blockcode>
permissionService.setInheritParentPermissions(documentNode, true);
</blockcode>