def getListDict(user):
machines = [m for m in Machine.select()
if validation.haveAccess(user, m)]
- #if user == 'moo':
- # machines = Machine.select()
- #else:
- # machines = Machine.query().join('users').filter_by(user=user).all()
checkpoint.checkpoint('Got my machines')
on = {}
has_vnc = {}
def getUser():
"""Return the current user based on the SSL environment variables"""
- if 'SSL_CLIENT_S_DN_Email' in os.environ:
- username = os.environ['SSL_CLIENT_S_DN_Email'].split("@")[0]
- return username
- else:
- return 'moo'
+ username = os.environ['SSL_CLIENT_S_DN_Email'].split("@")[0]
+ return username
def main(operation, user, fields):
start_time = time.time()
def haveAccess(user, machine):
"""Return whether a user has administrative access to a machine"""
- if user == 'moo':
- return True
if user in (machine.administrator, machine.owner):
return True
if getafsgroups.checkAfsGroup(user, machine.administrator,
def owns(user, machine):
"""Return whether a user owns a machine"""
- if user == 'moo':
- return True
return not getafsgroups.notLockerOwner(user, machine.owner)
def validMachineName(name):