Changeset 254
- Timestamp:
- Dec 29, 2007, 3:09:59 AM (17 years ago)
- Location:
- trunk/web
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/main.py
r252 r254 186 186 machines = [m for m in Machine.select() 187 187 if validation.haveAccess(user, m)] 188 #if user == 'moo':189 # machines = Machine.select()190 #else:191 # machines = Machine.query().join('users').filter_by(user=user).all()192 188 checkpoint.checkpoint('Got my machines') 193 189 on = {} … … 584 580 def getUser(): 585 581 """Return the current user based on the SSL environment variables""" 586 if 'SSL_CLIENT_S_DN_Email' in os.environ: 587 username = os.environ['SSL_CLIENT_S_DN_Email'].split("@")[0] 588 return username 589 else: 590 return 'moo' 582 username = os.environ['SSL_CLIENT_S_DN_Email'].split("@")[0] 583 return username 591 584 592 585 def main(operation, user, fields): -
trunk/web/validation.py
r253 r254 72 72 def haveAccess(user, machine): 73 73 """Return whether a user has administrative access to a machine""" 74 if user == 'moo':75 return True76 74 if user in (machine.administrator, machine.owner): 77 75 return True … … 85 83 def owns(user, machine): 86 84 """Return whether a user owns a machine""" 87 if user == 'moo':88 return True89 85 return not getafsgroups.notLockerOwner(user, machine.owner) 90 86
Note: See TracChangeset
for help on using the changeset viewer.