cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Role creation crashes old sites.

avin_jss
Champ on-the-rise
Champ on-the-rise
Hi,

    I have Alfresco 3.2 setup on ubuntu mysql tomcat.

    I already had some sites on my setup and then I got requirement to create some custom roles for new sites that will be created.

   I followed following link to make custom role  http://wiki.alfresco.com/wiki/Custom_Permissions_in_Share

    But As u can see its given in the link that this procedure is only valid for fresh share site, so all my old sites are crashing and throwing the error "An Authority was not found for Group_site_xxx_customrole".

  My requirement is to create custom roles so that they can be applied on new sites, and keeping old sites as they are.

    can anybody tell me how to make custom role so that old sites do not crash, OR suggest some changes in present error so that old sites start working.??

   here is error stack trace for debugging ……


23:35:25,478 ERROR [org.alfresco.web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 10220007 Wrapped Exception (with status template): 10220006 Failed to execute script '/org/alfresco/slingshot/documentlibrary/doclist.get.js (in classpath store file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 10220005 An authority was not found for GROUP_site_a_SiteCustomManager
org.alfresco.web.scripts.WebScriptException: 10220007 Wrapped Exception (with status template): 10220006 Failed to execute script '/org/alfresco/slingshot/documentlibrary/doclist.get.js (in classpath store file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 10220005 An authority was not found for GROUP_site_a_SiteCustomManager
   at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
   at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:357)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:407)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:424)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:288)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.scripts.ScriptException: 10220006 Failed to execute script '/org/alfresco/slingshot/documentlibrary/doclist.get.js (in classpath store file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 10220005 An authority was not found for GROUP_site_a_SiteCustomManager
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:178)
   at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:274)
   at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108)
   at org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)
   at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)
   … 21 more
Caused by: org.alfresco.repo.security.authority.UnknownAuthorityException: 10220005 An authority was not found for GROUP_site_a_SiteCustomManager
   at org.alfresco.repo.security.authority.AuthorityDAOImpl.getContainedAuthorities(AuthorityDAOImpl.java:246)
   at org.alfresco.repo.security.authority.AuthorityServiceImpl.getContainedAuthorities(AuthorityServiceImpl.java:313)
   at org.alfresco.repo.site.SiteServiceImpl.getPermissionGroups(SiteServiceImpl.java:1188)
   at org.alfresco.repo.site.SiteServiceImpl.getMembersRoles(SiteServiceImpl.java:1158)
   at org.alfresco.repo.site.SiteServiceImpl.getMembersRole(SiteServiceImpl.java:1132)
   at org.alfresco.repo.site.script.Site.getMembersRole(Site.java:327)
   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:585)
   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.c7._c8(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js:541)
   at org.mozilla.javascript.gen.c7.call(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
   at org.mozilla.javascript.gen.c7._c0(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js:409)
   at org.mozilla.javascript.gen.c7.call(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.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.c7.call(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js)
   at org.mozilla.javascript.gen.c7.exec(file:C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:449)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:174)
   … 25 more
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Please help as this solution is required urgently.

Thanks & regards
Avin
12 REPLIES 12

tomen
Champ in-the-making
Champ in-the-making
Hi,
I tried the js script, but I get this error :
Failed the actions due to error: Failed to execute script 06270393 'workspace://SpacesStore/b3deffd0-e0e0-47f3-b210-05e4f9c2c131': 06270392 ReferenceError: "MyCustomCollaborator" is not defined (workspace://SpacesStore/b3deffd0-e0e0-47f3-b210-05e4f9c2c131#10)‍
Did someone solve this issue ?

Thanks Smiley Wink

nadaoneal
Champ in-the-making
Champ in-the-making
We had a very similar issue for our site, but as far as we know, we didn't create any new custom roles; we just edited files like the workflowModel.xml, adhoc_processdefinition.xml, etc. We ended up getting the error for "GROUP_site_[sitename]_All" on all sites, which I think is an Alfresco default group.

kszosze's script worked for us, so I'm not sure what issue the other poster was having (though I note the same thing happened to a completely different person in this other thread). Did you remember to replace all instances of "CustomRole, CustomRole2" with your own value(s)?

tomen
Champ in-the-making
Champ in-the-making
In fact, I made a huge mistake, I replaced customeRole by SiteCustomManager instead of "SiteCustomManager" !

It works great.