cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a new permission in a repo amp

logxjb
Champ in-the-making
Champ in-the-making
Hello,

Following this tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html#implement...

I wanted to create a new permission.

In the model directory, I've made a duplicate of the original permissionDefinitions.xml file and added my new permission

<blockcode>
<permissionSet type="cm:cmobject" expose="selected">
    ….
    <permissionGroup name="SpecialContributor" allowFullControl="false" expose="true" >
        <includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
    </permissionGroup
</permissionSet>
</blockcode>

In the context directory, I've put the following in the service-context.xml file

<blockcode>
<beans>
   <bean id="${project.artifactId}_extendPermissionModel" parent="permissionModelBootstrap">
       <property name="models">
           <list>
               <value>alfresco/module/${project.artifactId}/model/permissionDefinitions.xml</value>
           </list>
       </property>
   </bean>
</beans>
</blockcode>

Anyway after applying the amp and restarting the server, I'm unable to login on Alfresco.

catalina.out says:

<blockcode>
Mar 31, 2014 1:42:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 34252 ms
2014-03-31 13:42:08,241  ERROR [solr.tracker.CoreTracker] [SolrTrackerScheduler_Worker-3] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 02310001 GetModelsDiff return status is 404
   at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1059)
   at org.alfresco.solr.tracker.CoreTracker.trackModels(CoreTracker.java:1897)
   at org.alfresco.solr.tracker.CoreTracker.trackRepository(CoreTracker.java:1227)
   at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:513)
   at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
</blockcode>

If I uninstall the amp, everything goes fine.

Thanks for any help,
Jérémy
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
I guess after you modfied existing model, when solr try to get model difference from alfresco , alfresco cann't deal with it correctly
you can check alfresco log to see if there are any errors.
If you just  replacing the default permission model and your permission model is legal.I think it's a bug.

Anyway I suggest you to extend the existing model instead of replace the default permission model.
you can extend the existing model using  following code snippet

<bean id="extendPermissionModel" parent="permissionModelBootstrap">
   <property name="model" value="alfresco/extension/permissionModelExtension.xml" />
</bean>

logxjb
Champ in-the-making
Champ in-the-making
Hello,

Thanks for your answer. If I put a permissionDefinitions.xml file in the "alfresco/extension/model" directory and create the bean file in extension directory, then everything works fine.

But if I do that, I'm totally outside my Maven AMP repo project. I may live with that, but hopped it could be possible to create new permissions inside a repo AMP module.

Regards,
Jérémy