from Products.CMFCore.utils import getToolByName
portal_url = getToolByName(context, "portal_url")
portal = portal_url.getPortalObject()
all_permissions = 
# context has a method valid_roles
for role in portal.valid_roles():
# role is a string of 'Contributor', 'Reader', etc.
permissions = portal.permissionsOfRole(role)
# permissions is a list of dicts
for permission in permissions:
# permission is a dict with keys 'selected' and 'name'
if permission['name'] not in all_permissions:
Friday, June 20, 2008
For a future PAS plugin, i wanted to create a (multi)select field on a content type that takes the available site permissions as a vocbulary. It took me a while to figure out how to get a list of all available permissions, so i'll put it here:
Posted by Kees Hink at 12:36 PM