Fix to admin
[invirt/packages/invirt-web.git] / templates / main.py
index a25257f..915b5eb 100755 (executable)
@@ -131,7 +131,9 @@ def haveAccess(user, machine):
         return True
     if user.username in (machine.administrator, machine.owner):
         return True
-    if getafsgroups.checkAfsGroup(user, machine.administrator, 'athena.mit.edu'): #XXX Cell?
+    if getafsgroups.checkAfsGroup(user.username, machine.administrator, 'athena.mit.edu'): #XXX Cell?
+        return True
+    if getafsgroups.checkLockerOwner(user.username, machine.owner):
         return True
     return owns(user, machine)
 
@@ -596,9 +598,9 @@ def testAdmin(user, admin, machine):
         return None
     if admin == user.username:
         return admin
-    if getafsgroups.checkAfsGroup(user, admin, 'athena.mit.edu'):
+    if getafsgroups.checkAfsGroup(user.username, admin, 'athena.mit.edu'):
         return admin
-    if getafsgroups.checkAfsGroup(user, 'system:'+admin, 'athena.mit.edu'):
+    if getafsgroups.checkAfsGroup(user.username, 'system:'+admin, 'athena.mit.edu'):
         return 'system:'+admin
     raise InvalidInput('admin', admin, 
                        'You must control the group you move it to')