Changeset 874 for trunk/packages/sipb-xen-www
- Timestamp:
- Aug 6, 2008, 1:07:22 AM (16 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/validation.py
r867 r874 126 126 def haveAccess(user, state, machine): 127 127 """Return whether a user has administrative access to a machine""" 128 return state.isadmin or user in cache_acls.accessList(machine) 128 return (user in cache_acls.accessList(machine) 129 or (machine.adminable and state.isadmin)) 129 130 130 131 def owns(user, machine): -
trunk/packages/sipb-xen-www/code/webcommon.py
r867 r874 2 2 3 3 import time 4 from invirt import database 4 5 from invirt.database import Machine, MachineAccess 5 6 … … 45 46 def getMachines(self): 46 47 if self.isadmin: 47 return Machine.select() 48 return Machine.query().join('acl').select_by( 49 database.or_(MachineAccess.c.user == self.username, 50 Machine.c.adminable == True)) 48 51 else: 49 52 return Machine.query().join('acl').select_by(user=self.username)
Note: See TracChangeset
for help on using the changeset viewer.