multi manager support in multi user mode
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 1.99.7 (2012-04-21 12:19:41) dev
|
||||
Version 1.99.7 (2012-04-22 20:18:56) dev
|
||||
|
||||
@@ -14,6 +14,8 @@ if MULTI_USER_MODE:
|
||||
mail.settings.sender = EMAIL_SENDER
|
||||
mail.settings.login = EMAIL_LOGIN
|
||||
|
||||
auth.settings.extra_fields['auth_user'] = \
|
||||
[Field('is_manager','boolean',default=False,writable=False)]
|
||||
auth.define_tables() # creates all needed tables
|
||||
auth.settings.registration_requires_verification = False
|
||||
auth.settings.registration_requires_approval = True
|
||||
@@ -30,7 +32,7 @@ if not session.authorized and MULTI_USER_MODE:
|
||||
def is_manager():
|
||||
if not MULTI_USER_MODE:
|
||||
return True
|
||||
elif auth.user and auth.user.id==1:
|
||||
elif auth.user and (auth.user.id==1 or auth.user.is_manager):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user