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:
Antoine Nguyen
2012-05-04 10:15:43 +02:00
parent a4fbb17c6c
commit a314c14fc4
3 changed files with 38 additions and 0 deletions
+7
View File
@@ -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')