12-07-2017 08:17 AM
Is there a standard way to allow Consumers (repo permission) the ability to comment on documents?
We are trying to extend the default Consumer role so that Consumer users can create comments. We have added the following code to our permissionDefinitions.xml but to no avail.
permissionDefinitions.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE permissions >
<permissions>
<namespaces>
<namespace uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<namespace uri="http://www.alfresco.org/model/forum/1.0" prefix="fm"/>
</namespaces>
<permissionSet type="fm:discussable" expose="selected">
<permissionGroup name="CreateComments" requiresType="true" expose="false">
<includePermissionGroup permissionGroup="CreateChildren" type="sys:base" />
</permissionGroup>
<permission name="_CreateComments" expose="false" >
<grantedToGroup permissionGroup="CreateComments" />
</permission>
</permissionSet>
<permissionSet type="fm:discussable" expose="selected">
<permissionGroup name="Consumer" allowFullControl="false" expose="true" >
<includePermissionGroup type="sys:base" permissionGroup="Read"/>
<includePermissionGroup type="fm:discussable" permissionGroup="CreateComments"/>
</permissionGroup>
</permissionSet>
</permissions>
And imported it to our module-context.xml using:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="extendPermissionModel" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/${project.artifactId}/permission/permissionDefinitions.xml" />
</bean>
</beans>
12-08-2017 02:27 AM
Gave up and just created a separate role instead of trying to extend Consumer
12-07-2017 12:03 PM
Check the following thread https://community.alfresco.com/thread/212273-howto-custom-permissions-in-alf-community-50d#comment-7...
It is old, but I believe it is still relevant for what you are trying to achieve.
12-07-2017 12:18 PM
We have also tried replacing the default permissionDefinitions.xml file also. Either we just get errors that CreateComment is not available for sys:base or cm:content and just adding the following to the file gives Access Denied using the REST call for adding comments.
<!-- CUSTOM CREATE COMMENTS -->
<permissionSet type="fm:discussable" expose="selected">
<permissionGroup name="CreateComments" extends="false" expose="false" />
<permissionGroup name="ReadComments" extends="false" expose="false" />
<permission name="_CreateComments" expose="false" >
<grantedToGroup permissionGroup="CreateComments" />
</permission>
<permission name="_ReadComments" expose="false" >
<grantedToGroup permissionGroup="ReadComments" />
</permission>
</permissionSet><permissionSet type="cm:cmobject" expose="selected">...
<permissionGroup name="Consumer" allowFullControl="false" expose="true" >
<includePermissionGroup permissionGroup="Read" type="sys:base" />
<includePermissionGroup permissionGroup="CreateComments" type="fm:discussable" />
</permissionGroup>
12-08-2017 02:27 AM
Gave up and just created a separate role instead of trying to extend Consumer
02-28-2018 03:44 AM
Hello Mike,
Can you tell me how you created this separate role? Especially how you grant (what) permissions to this role?
Thanks in advance
Explore our Alfresco products with the links below. Use labels to filter content by product module.