Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.conditions.role.RoleConditionExecutor Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 context
 element
 event

Detailed Description

The executor for this condition.

This is registered as an adapter in configure.zcml

Definition at line 41 of file role.py.


Constructor & Destructor Documentation

def plone.app.contentrules.conditions.role.RoleConditionExecutor.__init__ (   self,
  context,
  element,
  event 
)

Definition at line 49 of file role.py.

00049 
00050     def __init__(self, context, element, event):
00051         self.context = context
00052         self.element = element
00053         self.event = event

Here is the caller graph for this function:


Member Function Documentation

Definition at line 54 of file role.py.

00054 
00055     def __call__(self):
00056         portal_membership = getToolByName(self.context, 'portal_membership', None)
00057         if portal_membership is None:
00058             return False
00059         member = portal_membership.getAuthenticatedMember()
00060         roles_in_context = member.getRolesInContext(aq_inner(self.event.object))
00061         for r in self.element.role_names:
00062             if r in roles_in_context:
00063                 return True
00064         return False
        

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 50 of file role.py.

Definition at line 51 of file role.py.

Definition at line 52 of file role.py.


The documentation for this class was generated from the following file: