JoseLuis de la Rosa Triviño wrote:
> I'm developing on CPS 3.3.8 and I've created new portal types,
> especially new types of workspaces. When I try to Manage Local Roles
> over one instance of my workspaces I get a list with every role, even
> Section and Blog roles.
> 
> I need to say what roles can be assigned to my new type and I've found
> this page template (getCPSCandidateLocalRoles.pt):
> 
>  
> 
> ##################
> 
> """
> 
> XXX content moved into portal_membership
> 
>  
> 
> Override this template if you have new portal types or new roles with a
> 
> specific mapping to register.
> 
> """
> 
> from Products.CMFCore.utils import getToolByName
> 
> mtool = getToolByName(context, 'portal_membership')
> 
> return mtool.getCPSCandidateLocalRoles(context)
> 
> ##################
> 
>  
> 
> What I've done to customize it is this:
> 
>  
> 
> ##################
> 
> from Products.CMFCore.utils import getToolByName
> 
>  
> 
> newWorkspacesTypes = ['WorkspaceLinks', 'WorkspaceNews']  ## Define my
> new types identifiers.
> 
>  
> 
> if context.getTypeInfo().getId() in newWorkspacesTypes:
> 
>   roles = ['WorkspaceReader', 'WorkspaceMember', 'WorkspaceManager']  
> ## Tell what the valid roles are.
> 
> else:
> 
>   mtool = getToolByName(context, 'portal_membership')
> 
>   roles = mtool.getCPSCandidateLocalRoles(context)
> 
> return roles
> 
> ##################
> 
>  
> 
> This solution is a little bit Q&D. Is there another way to tell what
> roles are valid for a new content type?
> 

This is already targeted for 3.4.1

If you got remarks feel free to add them there :
http://svn.nuxeo.org/trac/pub/ticket/661

        J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
cps-users mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/cps-users

Reply via email to