Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions
GenericSetup.rolemap.RolemapExportConfigurator Class Reference
Inheritance diagram for GenericSetup.rolemap.RolemapExportConfigurator:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.rolemap.RolemapExportConfigurator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def listRoles
def listPermissions

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Member Functions

def _getExportTemplate

Detailed Description

Synthesize XML description of sitewide role-permission settings.

Definition at line 146 of file rolemap.py.


Member Function Documentation

Definition at line 197 of file rolemap.py.

00197 
00198     def _getExportTemplate(self):
00199 
00200         return PageTemplateFile('rmeExport.xml', _xmldir)
00201 
00202 InitializeClass(RolemapExportConfigurator)
00203 

List permissions for export.

o Returns a sqeuence of mappings describing locally-modified
  permission / role settings.  Keys include:

  'permission' -- the name of the permission

  'acquire' -- a flag indicating whether to acquire roles from the
      site's container

  'roles' -- the list of roles which have the permission.

o Do not include permissions which both acquire and which define
  no local changes to the acquired policy.

Definition at line 160 of file rolemap.py.

00160 
00161     def listPermissions( self ):
00162 
00163         """ List permissions for export.
00164 
00165         o Returns a sqeuence of mappings describing locally-modified
00166           permission / role settings.  Keys include:
00167 
00168           'permission' -- the name of the permission
00169 
00170           'acquire' -- a flag indicating whether to acquire roles from the
00171               site's container
00172 
00173           'roles' -- the list of roles which have the permission.
00174 
00175         o Do not include permissions which both acquire and which define
00176           no local changes to the acquired policy.
00177         """
00178         permissions = []
00179         valid_roles = self.listRoles()
00180 
00181         for perm in self._site.ac_inherited_permissions( 1 ):
00182 
00183             name = perm[ 0 ]
00184             p = Permission( name, perm[ 1 ], self._site )
00185             roles = p.getRoles( default=[] )
00186             acquire = isinstance( roles, list )  # tuple means don't acquire
00187             roles = [ r for r in roles if r in valid_roles ]
00188             roles.sort()
00189 
00190             if roles or not acquire:
00191                 permissions.append( { 'name'    : name
00192                                     , 'acquire' : acquire
00193                                     , 'roles'   : roles
00194                                     } )
00195 
00196         return permissions

Here is the call graph for this function:

List the valid role IDs for our site.

Definition at line 153 of file rolemap.py.

00153 
00154     def listRoles( self ):
00155 
00156         """ List the valid role IDs for our site.
00157         """
00158         return self._site.valid_roles()

Here is the caller graph for this function:


Member Data Documentation

tuple GenericSetup.rolemap.RolemapExportConfigurator.security = ClassSecurityInfo() [static]

Definition at line 150 of file rolemap.py.


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