import re
import string
from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall
+from invirt.config import structs as config
from webcommon import InvalidInput
MAX_MEMORY_TOTAL = 512
def haveAccess(user, state, machine):
"""Return whether a user has administrative access to a machine"""
- return state.isadmin or user in cache_acls.accessList(machine)
+ return (user in cache_acls.accessList(machine)
+ or (machine.adminable and state.isadmin))
def owns(user, machine):
"""Return whether a user owns a machine"""
return admin
admin = 'system:' + admin
try:
- if user in getafsgroups.getAfsGroupMembers(admin, 'athena.mit.edu'):
+ if user in getafsgroups.getAfsGroupMembers(admin, config.authz[0].cell):
return admin
except getafsgroups.AfsProcessError, e:
errmsg = str(e)