From 35568d9967fd7b5296c9caf93593ee34e82a05b0 Mon Sep 17 00:00:00 2001 From: Greg Brockman Date: Thu, 26 Aug 2010 01:05:00 -0400 Subject: [PATCH] Use expandOwner/expandAdmin rather than removed expandLocker --- code/validation.py | 5 +++-- debian/changelog | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/validation.py b/code/validation.py index 9b7a0b0..29cb310 100755 --- a/code/validation.py +++ b/code/validation.py @@ -5,6 +5,7 @@ import getafsgroups import re import string import dns.resolver +from invirt import authz from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall, Owner from invirt.config import structs as config from invirt.common import InvalidInput, CodeError @@ -129,7 +130,7 @@ def haveAccess(user, state, machine): def owns(user, machine): """Return whether a user owns a machine""" - return user in expandLocker(machine.owner) + return user in authz.expandOwner(machine.owner) def validMachineName(name): """Check that name is valid for a machine name""" @@ -244,7 +245,7 @@ def testOwner(user, owner, machine=None): if '@' in owner: raise InvalidInput('owner', owner, "No cross-realm Hesiod lockers allowed") try: - if user not in cache_acls.expandLocker(owner): + if user not in authz.expandOwner(owner): raise InvalidInput('owner', owner, 'You do not have access to the ' + owner + ' locker') except getafsgroups.AfsProcessError, e: diff --git a/debian/changelog b/debian/changelog index c8efb75..e416f92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ invirt-web (0.1.8) lucid; urgency=low + [ Andrew M. Farrell ] * Rename code/ to /var/www/invirt-web/ in binary-fixup - -- Andrew M. Farrell Thu, 26 Aug 2010 01:48:04 -0400 + [ Greg Brockman ] + * Use expandOwner/expandAdmin rather than removed expandLocker + + -- Greg Brockman Thu, 26 Aug 2010 02:24:57 -0400 invirt-web (0.1.7) unstable; urgency=low -- 1.7.9.5