cancel
Showing results for 
Search instead for 
Did you mean: 

Allow consumers to comment

mikepriest87
Champ on-the-rise
Champ on-the-rise

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>
1 ACCEPTED ANSWER

mikepriest87
Champ on-the-rise
Champ on-the-rise

Gave up and just created a separate role instead of trying to extend Consumer

View answer in original post

4 REPLIES 4

douglascrp
World-Class Innovator
World-Class Innovator

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.

mikepriest87
Champ on-the-rise
Champ on-the-rise

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>


mikepriest87
Champ on-the-rise
Champ on-the-rise

Gave up and just created a separate role instead of trying to extend Consumer

Hello Mike,

Can you tell me how you created this separate role? Especially how you grant (what) permissions to this role?

Thanks in advance Smiley Happy