app/soc/modules/ghop/views/helper/access.py
changeset 2841 2289f97d6216
parent 2840 41f7938a35b0
child 2922 6e373954bbf6
equal deleted inserted replaced
2840:41f7938a35b0 2841:2289f97d6216
   135   @access.denySidebar
   135   @access.denySidebar
   136   def checkRoleAndStatusForTask(self, django_args, allowed_roles,
   136   def checkRoleAndStatusForTask(self, django_args, allowed_roles,
   137                                 role_status, task_status):
   137                                 role_status, task_status):
   138     """Checks if the current user has access to the given task.
   138     """Checks if the current user has access to the given task.
   139 
   139 
       
   140     This method checks if the current user is in one of the allowed_roles
       
   141     and has specified role_status, If yes, allows him to access the Task page.
       
   142 
   140     Args:
   143     Args:
   141       django_args: a dictionary with django's arguments
   144       django_args: a dictionary with django's arguments
   142       allowed_roles: list with names for the roles allowed to pass access check
   145       allowed_roles: list with names for the roles allowed to pass access check
   143       role_status: list with states allowed for the role
   146       role_status: list with states allowed for the role
   144       task_status: a list with states allowed for the task
   147       task_status: a list with states allowed for the task
   196         message_fmt=DEF_NEED_ROLE_MSG)
   199         message_fmt=DEF_NEED_ROLE_MSG)
   197 
   200 
   198   def checkStatusForTask(self, django_args):
   201   def checkStatusForTask(self, django_args):
   199     """Checks if the current user has access to the given task.
   202     """Checks if the current user has access to the given task.
   200 
   203 
       
   204     This method checks if the current user is either an GHOP Org Admin or a
       
   205     Mentor and is active, if yes it allows them to view the task page at any
       
   206     task state. If the user is none of the above, it checks the status of the
       
   207     task, and if it is in one of the valid published states it allows access
       
   208     to view the task page.
       
   209 
   201     Args:
   210     Args:
   202       django_args: a dictionary with django's arguments
   211       django_args: a dictionary with django's arguments
   203 
   212 
   204      Raises:
   213      Raises:
   205        AccessViolationResponse:
   214        AccessViolationResponse: