From ea5305a135b44a864dd070050cec72de9f144223 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 27 Feb 2009 20:46:23 -0500 Subject: [PATCH] Start tracking the membership of the adminacl setting in the admins table. svn path=/trunk/packages/invirt-web/; revision=2223 --- code/cache_acls.py | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 code/cache_acls.py diff --git a/code/cache_acls.py b/code/cache_acls.py old mode 100644 new mode 100755 index fe69815..e18b3d0 --- a/code/cache_acls.py +++ b/code/cache_acls.py @@ -70,6 +70,16 @@ 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: + Admin.query.filter_by(user=removed).delete() + 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: -- 1.7.9.5