Back to index

plone3  3.1.7
Functions
PlonePAS.setuphandlers Namespace Reference

Functions

def addRolesToPlugIn
def setupGroups
def installPAS
def setupPlonePAS

Detailed Description

PlonePAS setup handlers.

Function Documentation

XXX This is horrible.. need to switch PlonePAS to a GenericSetup
based install so this doesn't need to happen.

Have to manually register the roles from the 'rolemap' step
with the roles plug-in.

Definition at line 17 of file setuphandlers.py.

00017 
00018 def addRolesToPlugIn(p):
00019     """
00020     XXX This is horrible.. need to switch PlonePAS to a GenericSetup
00021     based install so this doesn't need to happen.
00022 
00023     Have to manually register the roles from the 'rolemap' step
00024     with the roles plug-in.
00025     """
00026     uf = getToolByName(p, 'acl_users')
00027     rmanager = uf.portal_role_manager
00028     roles = ('Reviewer', 'Member')
00029     existing = rmanager.listRoleIds()
00030     for role in roles:
00031         if role not in existing:
00032             rmanager.addRole(role)
00033 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file setuphandlers.py.

00046 
00047 def installPAS(portal):
00048     out = StringIO()
00049     
00050     # Add user folder
00051     portal.manage_addProduct['PluggableAuthService'].addPluggableAuthService()
00052 
00053     # Configure Challenge Chooser plugin if available
00054     challenge_chooser_setup(portal, out)
00055 
00056     # A bunch of general configuration settings
00057     registerPluginTypes(portal.acl_users)
00058     setupPlugins(portal, out)
00059 
00060     # TODO: This is highly questionable behaviour. Replacing the UF at the root.
00061     migrate_root_uf(portal, out)
00062 

Here is the call graph for this function:

Here is the caller graph for this function:

Create Plone's default set of groups.

Definition at line 34 of file setuphandlers.py.

00034 
00035 def setupGroups(p):
00036     """
00037     Create Plone's default set of groups.
00038     """
00039     gtool = getToolByName(p, 'portal_groups')
00040     existing = gtool.listGroupIds()
00041     if 'Administrators' not in existing:
00042         gtool.addGroup('Administrators', roles=['Manager'])
00043     if 'Reviewers' not in existing:
00044         gtool.addGroup('Reviewers', roles=['Reviewer'])
00045 

Here is the call graph for this function:

Here is the caller graph for this function:

Setup PlonePAS step.

Definition at line 63 of file setuphandlers.py.

00063 
00064 def setupPlonePAS(context):
00065     """
00066     Setup PlonePAS step.
00067     """
00068     # Only run step if a flag file is present (e.g. not an extension profile)
00069     if context.readDataFile('plone-pas.txt') is None:
00070         return
00071     out = []
00072     site = context.getSite()
00073     installPAS(site)
00074     addRolesToPlugIn(site)
00075     setupGroups(site)
00076 
00077     setLoginFormInCookieAuth(site, out)

Here is the call graph for this function: