Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
DCWorkflow.WorkflowUIMixin.WorkflowUIMixin Class Reference

List of all members.

Public Member Functions

def setProperties
def manage_permissions
def addManagedPermission
def delManagedPermissions
def getPossiblePermissions
def getGroups
def getAvailableGroups
def addGroup
def delGroups
def getAvailableRoles
def getRoles
def setRoles
def getGuard
def guardExprDocs

Public Attributes

 title
 description
 manager_bypass
 creation_guard
 permissions
 groups
 roles

Static Public Attributes

tuple security = ClassSecurityInfo()
tuple manage_properties = DTMLFile('workflow_properties', _dtmldir)
tuple manage_groups = PageTemplateFile('workflow_groups.pt', _dtmldir)

Static Private Attributes

tuple _permissions_form = DTMLFile('workflow_permissions', _dtmldir)

Detailed Description

Definition at line 46 of file WorkflowUIMixin.py.


Member Function Documentation

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.addGroup (   self,
  group,
  RESPONSE = None,
  REQUEST = None 
)
Adds a group by name.

Definition at line 142 of file WorkflowUIMixin.py.

00142 
00143     def addGroup(self, group, RESPONSE=None, REQUEST=None):
00144         """Adds a group by name.
00145         """
00146         if group not in self.getAvailableGroups():
00147             raise ValueError(group)
00148         self.groups = self.groups + (group,)
00149         if RESPONSE is not None:
00150             RESPONSE.redirect(
00151                 "%s/manage_groups?manage_tabs_message=Added+group."
00152                 % self.absolute_url())

Here is the call graph for this function:

Here is the caller graph for this function:

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.addManagedPermission (   self,
  p,
  REQUEST = None 
)
Adds to the list of permissions to manage.

Definition at line 87 of file WorkflowUIMixin.py.

00087 
00088     def addManagedPermission(self, p, REQUEST=None):
00089         """Adds to the list of permissions to manage.
00090         """
00091         if p in self.permissions:
00092             raise ValueError, 'Already a managed permission: ' + p
00093         if REQUEST is not None and p not in self.getPossiblePermissions():
00094             raise ValueError, 'Not a valid permission name:' + p
00095         self.permissions = self.permissions + (p,)
00096         if REQUEST is not None:
00097             return self.manage_permissions(
00098                 REQUEST, manage_tabs_message='Permission added.')

Here is the call graph for this function:

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.delGroups (   self,
  groups,
  RESPONSE = None,
  REQUEST = None 
)
Removes groups by name.

Definition at line 155 of file WorkflowUIMixin.py.

00155 
00156     def delGroups(self, groups, RESPONSE=None, REQUEST=None):
00157         """Removes groups by name.
00158         """
00159         self.groups = tuple([g for g in self.groups if g not in groups])
00160         if RESPONSE is not None:
00161             RESPONSE.redirect(
00162                 "%s/manage_groups?manage_tabs_message=Groups+removed."
00163                 % self.absolute_url())

Here is the call graph for this function:

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.delManagedPermissions (   self,
  ps,
  REQUEST = None 
)
Removes from the list of permissions to manage.

Definition at line 101 of file WorkflowUIMixin.py.

00101 
00102     def delManagedPermissions(self, ps, REQUEST=None):
00103         """Removes from the list of permissions to manage.
00104         """
00105         if ps:
00106             l = list(self.permissions)
00107             for p in ps:
00108                 l.remove(p)
00109             self.permissions = tuple(l)
00110         if REQUEST is not None:
00111             return self.manage_permissions(
00112                 REQUEST, manage_tabs_message='Permission(s) removed.')

Here is the call graph for this function:

Returns a list of available group names.

Definition at line 127 of file WorkflowUIMixin.py.

00127 
00128     def getAvailableGroups(self):
00129         """Returns a list of available group names.
00130         """
00131         gf = aq_get( self, '__allow_groups__', None, 1 )
00132         if gf is None:
00133             return ()
00134         try:
00135             groups = gf.searchGroups()
00136         except AttributeError:
00137             return ()
00138         else:
00139             return [g['id'] for g in groups]

Here is the caller graph for this function:

Returns the acquired roles mixed with base_cms roles.

Definition at line 165 of file WorkflowUIMixin.py.

00165 
00166     def getAvailableRoles(self):
00167         """Returns the acquired roles mixed with base_cms roles.
00168         """
00169         roles = list(self.valid_roles())
00170         for role in getDefaultRolePermissionMap().keys():
00171             if role not in roles:
00172                 roles.append(role)
00173         roles.sort()
00174         return roles

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the names of groups managed by this workflow.

Definition at line 121 of file WorkflowUIMixin.py.

00121 
00122     def getGroups(self):
00123         """Returns the names of groups managed by this workflow.
00124         """
00125         return tuple(self.groups)

Here is the caller graph for this function:

Returns the initiation guard.

If no init guard has been created, returns a temporary object.

Definition at line 205 of file WorkflowUIMixin.py.

00205 
00206     def getGuard(self):
00207         """Returns the initiation guard.
00208 
00209         If no init guard has been created, returns a temporary object.
00210         """
00211         if self.creation_guard is not None:
00212             return self.creation_guard
00213         else:
00214             return Guard().__of__(self)  # Create a temporary guard.

Returns the list of all permissions that can be managed.

Definition at line 114 of file WorkflowUIMixin.py.

00114 
00115     def getPossiblePermissions(self):
00116         """Returns the list of all permissions that can be managed.
00117         """
00118         # possible_permissions is in AccessControl.Role.RoleManager.
00119         return list(self.possible_permissions())

Here is the caller graph for this function:

Returns the list of roles managed by this workflow.

Definition at line 176 of file WorkflowUIMixin.py.

00176 
00177     def getRoles(self):
00178         """Returns the list of roles managed by this workflow.
00179         """
00180         roles = self.roles
00181         if roles is not None:
00182             return roles
00183         roles = getDefaultRolePermissionMap().keys()
00184         if roles:
00185             # Map the base_cms roles by default.
00186             roles.sort()
00187             return roles
00188         return self.valid_roles()

Here is the call graph for this function:

Here is the caller graph for this function:

Returns documentation on guard expressions.

Definition at line 216 of file WorkflowUIMixin.py.

00216 
00217     def guardExprDocs(self):
00218         """Returns documentation on guard expressions.
00219         """
00220         here = os.path.dirname(__file__)
00221         fn = os.path.join(here, 'doc', 'expressions.stx')
00222         f = open(fn, 'rt')
00223         try:
00224             text = f.read()
00225         finally:
00226             f.close()
00227         from DocumentTemplate.DT_Var import structured_text
00228         return structured_text(text)
00229 
00230 InitializeClass(WorkflowUIMixin)
def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.manage_permissions (   self,
  REQUEST,
  manage_tabs_message = None 
)
Displays the form for choosing which permissions to manage.

Definition at line 77 of file WorkflowUIMixin.py.

00077 
00078     def manage_permissions(self, REQUEST, manage_tabs_message=None):
00079         """Displays the form for choosing which permissions to manage.
00080         """
00081         return self._permissions_form(REQUEST,
00082                                       management_view='Permissions',
00083                                       manage_tabs_message=manage_tabs_message,
00084                                       )

Here is the caller graph for this function:

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.setProperties (   self,
  title,
  manager_bypass = 0,
  props = None,
  REQUEST = None,
  description = '' 
)
Sets basic properties.

Definition at line 59 of file WorkflowUIMixin.py.

00059 
00060                       REQUEST=None, description=''):
00061         """Sets basic properties.
00062         """
00063         self.title = str(title)
00064         self.description = str(description)
00065         self.manager_bypass = manager_bypass and 1 or 0
00066         g = Guard()
00067         if g.changeFromProperties(props or REQUEST):
00068             self.creation_guard = g
00069         else:
00070             self.creation_guard = None
00071         if REQUEST is not None:
00072             return self.manage_properties(
00073                 REQUEST, manage_tabs_message='Properties changed.')

def DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.setRoles (   self,
  roles,
  RESPONSE = None,
  REQUEST = None 
)
Changes the list of roles mapped to groups by this workflow.

Definition at line 191 of file WorkflowUIMixin.py.

00191 
00192     def setRoles(self, roles, RESPONSE=None, REQUEST=None):
00193         """Changes the list of roles mapped to groups by this workflow.
00194         """
00195         avail = self.getAvailableRoles()
00196         for role in roles:
00197             if role not in avail:
00198                 raise ValueError(role)
00199         self.roles = tuple(roles)
00200         if RESPONSE is not None:
00201             RESPONSE.redirect(
00202                 "%s/manage_groups?manage_tabs_message=Roles+changed."
00203                 % self.absolute_url())

Here is the call graph for this function:


Member Data Documentation

tuple DCWorkflow.WorkflowUIMixin.WorkflowUIMixin._permissions_form = DTMLFile('workflow_permissions', _dtmldir) [static, private]

Definition at line 74 of file WorkflowUIMixin.py.

Definition at line 67 of file WorkflowUIMixin.py.

Definition at line 63 of file WorkflowUIMixin.py.

Definition at line 147 of file WorkflowUIMixin.py.

tuple DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.manage_groups = PageTemplateFile('workflow_groups.pt', _dtmldir) [static]

Definition at line 54 of file WorkflowUIMixin.py.

tuple DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.manage_properties = DTMLFile('workflow_properties', _dtmldir) [static]

Definition at line 53 of file WorkflowUIMixin.py.

Definition at line 64 of file WorkflowUIMixin.py.

Definition at line 94 of file WorkflowUIMixin.py.

Definition at line 198 of file WorkflowUIMixin.py.

tuple DCWorkflow.WorkflowUIMixin.WorkflowUIMixin.security = ClassSecurityInfo() [static]

Definition at line 50 of file WorkflowUIMixin.py.

Definition at line 62 of file WorkflowUIMixin.py.


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