[gen] Created param config.groupsForGlobalRoles that disabled by default creation of a group for every global role. On a appy class it is now possible to define a static method 'generateUid' that generates a UID for every instance of this class, instead of using the standard Appy way to produce such UIDs. [shared] dav.Resource: allow to retrieve the result encoded or not in utf8.

This commit is contained in:
Gaetan Delannay 2013-07-23 17:07:27 +02:00
parent d385b8514e
commit 88bd5e5bce
9 changed files with 42 additions and 20 deletions

View file

@ -250,14 +250,16 @@ class ZopeInstaller:
appyTool.log('Group "admins" created.')
# Create a group for every global role defined in the application
for role in self.config.applicationGlobalRoles:
relatedGroup = '%s_group' % role
if appyTool.count('Group', noSecurity=True, login=relatedGroup):
continue
appyTool.create('groups', noSecurity=True, login=relatedGroup,
title=relatedGroup, roles=[role])
appyTool.log('Group "%s", related to global role "%s", was ' \
'created.' % (relatedGroup, role))
# (if required).
if self.app.config.getProductConfig().groupsForGlobalRoles:
for role in self.config.applicationGlobalRoles:
groupId = role.lower()
if appyTool.count('Group', noSecurity=True, login=groupId):
continue
appyTool.create('groups', noSecurity=True, login=groupId,
title=role, roles=[role])
appyTool.log('Group "%s", related to global role "%s", was ' \
'created.' % (groupId, role))
# Create POD templates within the tool if required
for contentType in self.config.attributes.iterkeys():
@ -307,11 +309,8 @@ class ZopeInstaller:
id=language, title=title)
appyTool.log('Translation object created for "%s".' % language)
# Execute custom installation code if any
if hasattr(appyTool, 'onInstall'): appyTool.onInstall()
# Now, if required, we synchronise every Translation object with the
# corresponding "po" file on disk.
# Synchronize, if required, synchronise every Translation object with
# the corresponding "po" file on disk.
if appyTool.loadTranslationsAtStartup:
appFolder = self.config.diskFolder
appName = self.config.PROJECTNAME
@ -325,6 +324,9 @@ class ZopeInstaller:
appyTool.log('Translation "%s" updated from "%s".' % \
(translation.id, poName))
# Execute custom installation code if any.
if hasattr(appyTool, 'onInstall'): appyTool.onInstall()
def configureSessions(self):
'''Configure the session machinery.'''
# Register a function warning us when a session object is deleted. When