AnsweredAssumed Answered

Problem with Consumer permission

Question asked by tino2000 on Jan 23, 2015
I need to create a new role that can not download.

I created a new role and a new permission adding the following code to the following files.
permissionDefinitions.xml:

<permissionGroup name="DownloadPermission" expose="true" allowFullControl="false" />
                       
<permission name="_DownloadPermission" expose="false" >
     <grantedToGroup permissionGroup="DownloadPermission" />
</permission>


sitePermissionDefinitions.xml:

<permissionSet type="st:site" expose="selected">
     <permissionGroup name="SiteManager" allowFullControl="true" expose="true">
          <includePermissionGroup permissionGroup="DownloadPermission" type="sys:base" />
     </permissionGroup>
     <permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true">
          <includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
          <includePermissionGroup permissionGroup="DownloadPermission" type="sys:base" />
     </permissionGroup>
     <permissionGroup name="SiteContributor" allowFullControl="false" expose="true">
          <includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" />
          <includePermissionGroup permissionGroup="DownloadPermission" type="sys:base" />
     </permissionGroup>
     <permissionGroup name="SiteCustomManager" allowFullControl="false" expose="true">
          <includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" />
          <includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
     </permissionGroup>
     <permissionGroup name="SiteConsumer" allowFullControl="false" expose="true">
          <includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" />
          <includePermissionGroup permissionGroup="DownloadPermission" type="sys:base" />
     </permissionGroup>
</permissionSet>


script-services-context.xml:

<property name="userPermissions">
     <list>
          <value>CancelCheckOut</value>
          <value>ChangePermissions</value>
          <value>CreateChildren</value>
          <value>Delete</value>
          <value>Write</value>
          <value>DownloadPermission</value>
     </list>
</property>


To remove the download button I added the following code to the file share-config-custom.xml:

<config evaluator="string-compare" condition="DocLibActions">
     <actionGroups>
          <actionGroup id="document-browse">
               <action index="100" id="document-download">       
                    <permissions>
                         <permission allow="true">DownloadPermission</permission>
                    </permissions>
               </action>
          </actionGroup>
     </actionGroups>
</config>


Then I applied the fix for existing sites as published on Alfresco wiki (here: http://wiki.alfresco.com/wiki/Custom_Permissions_in_Share).

Working on my local machine everything works properly but by implementing changes to the server I had problems.

For the sites created after I made the changes there is no problem, but for the old sites the Consumer role can’t see anymore the “download button”, the behaviour  is the same for Consumer Role and the SiteCustomManager Role, it seems they have the same privileges.

After doing several test and trying alternative ways, I can’t find the problem, I don’t understand why it works on some sites and others do not.

The Alfresco Share environment on target server is customized but no changes have been made on the roles.

Has anybody ever had the same problem? Anyone could give me some help to solve the problem?

Outcomes