Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes
PluggableAuthService.plugins.DynamicGroupsPlugin.DynamicGroupDefinition Class Reference
Inheritance diagram for PluggableAuthService.plugins.DynamicGroupsPlugin.DynamicGroupDefinition:
Inheritance graph
[legend]
Collaboration diagram for PluggableAuthService.plugins.DynamicGroupsPlugin.DynamicGroupDefinition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 title
 description
 active
 predicate

Static Public Attributes

string meta_type = 'Dynamic Group Definition'
tuple security = ClassSecurityInfo()
tuple manage_options

Private Member Functions

def _setPredicate
def _getPredicate
def _updateProperty

Static Private Attributes

 _v_compiled = None
tuple _properties

Detailed Description

Represent a single dynamic group.

Definition at line 67 of file DynamicGroupsPlugin.py.


Constructor & Destructor Documentation

def PluggableAuthService.plugins.DynamicGroupsPlugin.DynamicGroupDefinition.__init__ (   self,
  id,
  predicate,
  title,
  description,
  active 
)

Definition at line 100 of file DynamicGroupsPlugin.py.

00100 
00101     def __init__( self, id, predicate, title, description, active ):
00102 
00103         self._setId( id )
00104         self._setPredicate( predicate )
00105 
00106         self.title = title
00107         self.description = description
00108         self.active = bool( active )

Here is the call graph for this function:


Member Function Documentation

Evaluate our expression to determine whether 'principal' belongs.

Definition at line 109 of file DynamicGroupsPlugin.py.

00109 
00110     def __call__( self, principal, request=None ):
00111 
00112         """ Evaluate our expression to determine whether 'principal' belongs.
00113         """
00114         predicate = self._getPredicate()
00115         plugin = aq_parent( aq_inner( self ) )
00116         properties = {}
00117 
00118         for k, v in self.propertyItems():
00119             properties[ k ] = v
00120 
00121         data = getEngine().getContext( { 'request' :    request
00122                                        , 'nothing' :    None
00123                                        , 'principal' :  principal
00124                                        , 'group' :      properties
00125                                        , 'plugin' :     plugin
00126                                        } )
00127 
00128         result = predicate( data )
00129 
00130         if isinstance( result, Exception ):
00131             raise result
00132 
00133         return result

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 143 of file DynamicGroupsPlugin.py.

00143 
00144     def _getPredicate( self ):
00145 
00146         if self._v_compiled is None:
00147             self._v_compiled = getEngine().compile( self.predicate )
00148 
00149         return self._v_compiled

Here is the caller graph for this function:

Definition at line 135 of file DynamicGroupsPlugin.py.

00135 
00136     def _setPredicate( self, predicate ):
00137 
00138         self.predicate = predicate
00139 
00140         if self._v_compiled is not None:
00141             del self._v_compiled

Here is the caller graph for this function:

Definition at line 151 of file DynamicGroupsPlugin.py.

00151 
00152     def _updateProperty( self, id, value ):
00153 
00154         if id == 'predicate':
00155             self._setPredicate( value )
00156 
00157         else:
00158             PropertyManager._updateProperty( self, id, value )

Here is the call graph for this function:


Member Data Documentation

Initial value:
( { 'id' : 'id'
                    , 'type' : 'string'
                    , 'mode' : ''
                    }
                  , { 'id' : 'predicate'
                    , 'type' : 'string'
                    , 'mode' : 'w'
                    }
                  , { 'id' : 'title'
                    , 'type' : 'string'
                    , 'mode' : 'w'
                    }
                  , { 'id' : 'description'
                    , 'type' : 'text'
                    , 'mode' : 'w'
                    }
                  , { 'id' : 'active'
                    , 'type' : 'boolean'
                    , 'mode' : 'w'
                    }
                  )

Definition at line 78 of file DynamicGroupsPlugin.py.

Definition at line 75 of file DynamicGroupsPlugin.py.

Definition at line 107 of file DynamicGroupsPlugin.py.

Definition at line 106 of file DynamicGroupsPlugin.py.

Initial value:
( PropertyManager.manage_options
                     + SimpleItem.manage_options
                     )

Definition at line 162 of file DynamicGroupsPlugin.py.

Definition at line 71 of file DynamicGroupsPlugin.py.

Definition at line 137 of file DynamicGroupsPlugin.py.

Definition at line 72 of file DynamicGroupsPlugin.py.

Definition at line 105 of file DynamicGroupsPlugin.py.


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