app/soc/views/helper/access.py
changeset 713 bcd480745f44
parent 709 e71b20847eb0
child 714 3e2ce3d8057a
equal deleted inserted replaced
712:b9e4cc00f30a 713:bcd480745f44
   283 
   283 
   284   login_message_fmt = DEF_DEV_LOGOUT_LOGIN_MSG_FMT % {
   284   login_message_fmt = DEF_DEV_LOGOUT_LOGIN_MSG_FMT % {
   285       'role': 'a host for this program'}
   285       'role': 'a host for this program'}
   286 
   286 
   287   splitpath = request.path.split('/')
   287   splitpath = request.path.split('/')
       
   288   splitpath = splitpath[1:] # cut off leading ''
   288 
   289 
   289   if len(splitpath) < 4:
   290   if len(splitpath) < 4:
   290     # TODO: perhaps this needs a better explanation?
   291     # TODO: perhaps this needs a better explanation?
   291     deny(request)
   292     deny(request)
   292 
   293 
   293   role = splitpath[1]
   294   role = splitpath[0]
   294   group_id = splitpath[3]
   295   group_id = splitpath[2]
   295   user_id = splitpath[4]
   296   user_id = splitpath[3]
   296 
   297 
   297   user = user_logic.logic.getForFields(
   298   user = user_logic.logic.getForFields(
   298       {'account': users.get_current_user()}, unique=True)
   299       {'account': users.get_current_user()}, unique=True)
   299 
   300 
   300   if user_id != user.link_id:
   301   if user_id != user.link_id: