- Timestamp:
- Aug 6, 2008, 1:07:22 AM (16 years ago)
- Location:
- trunk/packages
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-database/debian/changelog
r842 r874 1 sipb-xen-database (10.18) unstable; urgency=low 2 3 * add 'adminable' column to machines; for selectively, temporarily, 4 enabling admin mode on a machine 5 6 -- Greg Price <price@mit.edu> Wed, 6 Aug 2008 01:02:59 -0400 7 1 8 sipb-xen-database (10.17) unstable; urgency=low 2 9 -
trunk/packages/sipb-xen-database/python/database/models.py
r630 r874 21 21 'CDROM', 22 22 'Autoinstall', 23 'or_', 23 24 ] 24 25 … … 37 38 Column('type_id', String, ForeignKey('types.type_id'), nullable=False), 38 39 Column('autorestart', Boolean, nullable=False, default=False), 39 Column('cpus', Integer, nullable=False, default=1)) 40 Column('cpus', Integer, nullable=False, default=1), 41 Column('adminable', Boolean, nullable=False, default=False)) 40 42 41 43 nic_table = Table('nics', meta, -
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.