mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-26 06:08:38 +01:00
wip: UI refactoring
Better behaviour on role change: * If an account is promoted superuser, give it access to everything * If an account is demoted from his position as superuser, remove all its accesses. see #204
This commit is contained in:
@@ -138,6 +138,13 @@ def on_account_modified(old, new):
|
||||
if not new.group in ["DomainAdmins", "Resellers"]:
|
||||
move_pool_resource(owner, new)
|
||||
|
||||
try:
|
||||
pool = new.limitspool
|
||||
except LimitsPool.DoesNotExist:
|
||||
p = LimitsPool(user=new)
|
||||
p.save()
|
||||
p.create_limits()
|
||||
|
||||
if old.oldgroup == "DomainAdmins":
|
||||
if new.group != "DomainAdmins":
|
||||
dec_limit(owner, 'domain_admins_limit')
|
||||
|
||||
Reference in New Issue
Block a user