Restricting create content menu for a custom type, based on a custom role

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

Restricting create content menu for a custom type, based on a custom role

HI. I am having problems restricting the create content menu items, based on the Permissions of a folder. I am using the following custom role definition:

<permissionSet type="cm:cmobject" expose="selected">

   <permissionGroup name="GestorDocumental" allowFullControl="false" expose="true">
      <includePermissionGroup permissionGroup="Editor" type="cm:cmobject" />
      <includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" />
      <includePermissionGroup permissionGroup="Delete" type="sys:base" />
   </permissionGroup>
   <permissionGroup name="CIDGestorArchivo" allowFullControl="false" expose="true">
      <includePermissionGroup permissionGroup="GestorDocumental" type="cm:folder" />
   </permissionGroup>
</permissionSet>

<permissionSet type="cm:folder" expose="selected">

   <permissionGroup name="CIDGestorArchivo" extends="true" expose="true"/>
</permissionSet>

And the relevant share form config is:

<create-content>
   <content id="fotoAGADU" label="CIDDAE --> Foto de AGADU" type="pagelink" icon="img" index="230" >
      <param name="page">create-content?destination={nodeRef}&amp;itemId=im:cid_fotoAGADU&amp;mimeType=text/html</param>
      <permissions>
         <permission allow="true">CIDGestorArchivo</permission>
      </permissions>
   </content>
</create-content>

I have two problems with this config running an Alfresco Community 5.1 with Tomcat 9:

  1. The Label for the new role is not loaded from /conf/alfresco/messages/common.properties. The only solution I have found is to modify the war and change the file there, but that should not be done obviously.
  2. Although the custom role is created and I can assign it without problems to a folder, the user with the given permission still can't create content of the custom type, the option is removed from the menu and never shown.

Any help with any of this, would be greatly appreciated folks.

1 Reply
reynanuy
Member II

Re: Restricting create content menu for a custom type, based on a custom role

Hey guys. I managed to get the Create Content menu restriction working, but only with a default base permission like ChangePermissions. This of course is not acceptable, as I need the custom role I mentioned before, but can help give us a clue of what is going wrong here. This is the code I used by the way:

<create-content>
   <content id="fotoAGADU" label="CIDDAE --> Foto de AGADU" type="pagelink" icon="img" index="230" >
      <param name="page">create-content?destination={nodeRef}&amp;itemId=im:cid_fotoAGADU&amp;mimeType=text/html</param>
      <permissions>
         <permission allow="true">ChangePermissions</permission>
      </permissions>
   </content>
</create-content>