AnsweredAssumed Answered

hasPermission always returns true for a custom permission

Question asked by manojch on Dec 30, 2010
I want to create a custom permission (that is not related to any of the permissions), and related groups for same.

I plan to test this permission only in webscripts to control certain operations on the documents. I am testing the custom permission using node.hasPermission ('TestPerm')

The problem is that it always returns true irrespective of this PermissionGroup being assigned or not to the users.

I have created the new permission in permissionDefinitions.xml as follows

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

     <permission name="_TestPerm" requiresType="true" expose="false">
       <grantedtoGroup permissionGroup="TestPerm"/>
     <permissionGroup name="TestPerm" expose="true" allowFullControl="false"/>


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

      <!– Content specific roles.                                                       –>
      <permissionGroup name="Coordinator" extends="true" expose="true"/>
      <permissionGroup name="Collaborator" extends="true" expose="true"/>
      <permissionGroup name="Contributor" extends="true" expose="true"/>
      <permissionGroup name="Editor" extends="true" expose="true"/>
      <permissionGroup name="Consumer" extends="true" expose="true"/>
      <permissionGroup name="RecordAdministrator" extends="true" expose="false"/>

     <permissionGroup name="TestPerm" extends="true" expose="true"/>

i am using alfresco 3.3g community edition.

Is there anything more that needs to be done ?