Now ignore negative rights, rather than treat them as positive.
[invirt/packages/invirt-web.git] / templates / validation.py
index 4165aa9..ccb4fef 100644 (file)
@@ -75,7 +75,7 @@ def haveAccess(user, machine):
     if getafsgroups.checkAfsGroup(user, machine.administrator, 
                                   'athena.mit.edu'): #XXX Cell?
         return True
-    if getafsgroups.checkLockerOwner(user, machine.owner):
+    if not getafsgroups.notLockerOwner(user, machine.owner):
         return True
     return owns(user, machine)
 
@@ -83,7 +83,7 @@ def owns(user, machine):
     """Return whether a user owns a machine"""
     if user == 'moo':
         return True
-    return getafsgroups.checkLockerOwner(user, machine.owner)
+    return not getafsgroups.notLockerOwner(user, machine.owner)
 
 def validMachineName(name):
     """Check that name is valid for a machine name"""
@@ -168,7 +168,7 @@ def testOwner(user, owner, machine=None):
         return owner
     if owner is None:
         raise InvalidInput('owner', owner, "Owner must be specified")
-    value = getafsgroups.checkLockerOwner(user, owner, verbose=True)
+    value = getafsgroups.notLockerOwner(user, owner)
     if not value:
         return owner
     raise InvalidInput('owner', owner, value)