Personal tools
You are here: Home Weblog Archive 2006 August 29 Checking for a role or a permission in a context
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Checking for a role or a permission in a context

by tibi last modified 2006-08-29 11:51
Filed Under:

There are two very useful methods to check for certain security settings offered by the Plone API. First, to check if a user has a certain role, the following snippet can be used:

roles_user_has = portal_membership.getCandidateLocalRoles(here)

To check if a user has a certain permission, this API method can be used:

portal_membership.checkPermission('Manage portal', here)
Weblog
Atom
RDF
RSS 2.0
Powered by Quills
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: