|
Hello!
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?
Thank you very much. JoseLuis de la Rosa
Triviño
Este correo electrónico y, en su caso, cualquier fichero anexo, contiene información confidencial exclusivamente dirigida a su(s) destinatario(s). Toda copia o divulgación deberá ser autorizada por IAVANTE. This e-mail and any attachments are confidential and exclusively directed to its adressee(s). Any copy or distribution will have to be authorized by IAVANTE.
|
_______________________________________________ cps-users mailing list [email protected] http://lists.nuxeo.com/mailman/listinfo/cps-users
