How to add custom Custom Permissions and Roles in Alfresco Share ?

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

How to add custom Custom Permissions and Roles in Alfresco Share ?

Jump to solution

Hey,

I'm trying to add custom permissions in alfresco, I found this to be relevant actually :

https://community.alfresco.com/docs/DOC-5840-custom-permissions-in-share

When I tried it, I'm not able to get the desired result. But, by changing the sitePermissionDefinitions.xml directly inside the alfresco-repository-5.2.g.jar file which is located inside alfresco-community/tomcat/webapps/alfresco/WEB-INF/lib works fine.  The problem with this approach is that, whenever I deploy an .amp file, the jar file gets overwritten and all the new permissions I created is gone. 

Can anyone point me to the right direction on how this can be done. 

Thank you

1 Solution

Accepted Solutions
Professional

Re: How to add custom Custom Permissions and Roles in Alfresco Share ?

Jump to solution

It is good that you are asking about this because any time you find yourself having to touch a file in the webapp you should stop and find a better way. Unfortunately, many people ignore that, just patch the JAR, and move on, which creates a mess for others to clean up later.

When you say, "I'm not able to get the desired result," what, exactly, is the problem? Are you seeing errors? If so, what are they?

You can definitely extend permissions without touching a core file. Maybe you created the permissions XML file but you forgot to wire it in to Spring with a bean, like:

<bean id="com.someco.customPermissionDefinitions" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/${project.artifactId}/model/customPermissionDefinitions.xml"/>
</bean>

View solution in original post

2 Replies
Professional

Re: How to add custom Custom Permissions and Roles in Alfresco Share ?

Jump to solution

It is good that you are asking about this because any time you find yourself having to touch a file in the webapp you should stop and find a better way. Unfortunately, many people ignore that, just patch the JAR, and move on, which creates a mess for others to clean up later.

When you say, "I'm not able to get the desired result," what, exactly, is the problem? Are you seeing errors? If so, what are they?

You can definitely extend permissions without touching a core file. Maybe you created the permissions XML file but you forgot to wire it in to Spring with a bean, like:

<bean id="com.someco.customPermissionDefinitions" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/${project.artifactId}/model/customPermissionDefinitions.xml"/>
</bean>

View solution in original post

Active Member II

Re: How to add custom Custom Permissions and Roles in Alfresco Share ?

Jump to solution

Hey Jeff,

Thanks for the reply.

I was going with the wrong approach all this while. Trying to patch the JAR file. Now I did extend the permissions and wired it in to the Spring bean. And it actually worked.

Thank you.