Allow consumers to comment

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

Allow consumers to comment

Jump to solution

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 Solution

Accepted Solutions
mikepriest87
Active Member

Re: Allow consumers to comment

Jump to solution

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

View solution in original post

4 Replies
douglascrp
Advanced II

Re: Allow consumers to comment

Jump to solution

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
Active Member

Re: Allow consumers to comment

Jump to solution

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
Active Member

Re: Allow consumers to comment

Jump to solution

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

sychel
Active Member

Re: Allow consumers to comment

Jump to solution

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