AnsweredAssumed Answered

How to define specific role on a custom type

Question asked by seb55555 on Dec 23, 2009

I am on Alfresco 3.1

I have define a custom type "mycompany:cdc".
I have define a custom role "MyNewRole" like this :
<permissionGroup name="MyNewRole"  expose="true" allowFullControl="false" >
          <includePermissionGroup type="cm:cmobject" permissionGroup="Consumer"/>
          <includePermissionGroup type="sys:base" permissionGroup="Write"/>
          <includePermissionGroup type="cm:lockable" permissionGroup="CheckOut"/>
          <includePermissionGroup type="sys:base" permissionGroup="ReadPermissions"/>

I would like to restrict access of my content type "mycompany:cdc" to only person who have the role "MyNewRole".

So I have add the folllowing lines in permissionDefinitions.xml :

<permissionSet type="mycompany:cdc" expose="selected">
      <permissionGroup name="MyNewRole" extends="true" expose="true"/>

When I start Alfresco, I have the following error :

11:13:15,722  ERROR [web.context.ContextLoader] Context initialization failed

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionsModelDAO' defined in class path resource [alfresco/public-services-security-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
The QName of my type is not reconized.

It seems that it is not the good way to do this.
How can I do that ?