X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/0afc684b6680df25b4bd32ab6c94e208df3d986f..2e60cdc0ff93ce9858eed6fdbdf9fff2037d07f1:/code/cache_acls.py diff --git a/code/cache_acls.py b/code/cache_acls.py old mode 100644 new mode 100755 index fe69815..f92ad91 --- a/code/cache_acls.py +++ b/code/cache_acls.py @@ -70,6 +70,17 @@ def refreshCache(): refreshMachine(m) session.flush() + # Update the admin ACL as well + admin_acl = set(expandName(config.adminacl)) + old_admin_acl = set(a.user for a in Admin.query()) + for removed in old_admin_acl - admin_acl: + old = Admin.query.filter_by(user=removed).first() + session.delete(old) + for added in admin_acl - old_admin_acl: + a = Admin(user=added) + session.save_or_update(a) + session.flush() + # Atomically execute our changes session.commit() except: