X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/aa1a40fe65ba60717548c038da6ddcd9ba8c7782..refs/heads/gdb-git:/code/validation.py?ds=sidebyside diff --git a/code/validation.py b/code/validation.py old mode 100644 new mode 100755 index 9b7a0b0..29cb310 --- 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: