Changeset 2223


Ignore:
Timestamp:
Feb 27, 2009, 8:46:23 PM (16 years ago)
Author:
broder
Message:

Start tracking the membership of the adminacl setting in the admins table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/cache_acls.py

    • Property svn:executable set to *
    r1986 r2223  
    7171        session.flush()
    7272           
     73        # Update the admin ACL as well
     74        admin_acl = set(expandName(config.adminacl))
     75        old_admin_acl = set(a.user for a in Admin.query())
     76        for removed in old_admin_acl - admin_acl:
     77            Admin.query.filter_by(user=removed).delete()
     78        for added in admin_acl - old_admin_acl:
     79            a = Admin(user=added)
     80            session.save_or_update(a)
     81        session.flush()
     82   
    7383        # Atomically execute our changes
    7484        session.commit()
Note: See TracChangeset for help on using the changeset viewer.