app/soc/views/helper/access.py
changeset 2521 7c120301989c
parent 2514 53fabbd7c6f3
child 2522 b97b3c8e5736
equal deleted inserted replaced
2520:859ada69db69 2521:7c120301989c
  1673       user: valid user on the website
  1673       user: valid user on the website
  1674       public: anyone can participate in the survey
  1674       public: anyone can participate in the survey
  1675     """
  1675     """
  1676 
  1676 
  1677     if django_args['prefix'] != 'program':
  1677     if django_args['prefix'] != 'program':
  1678       # TODO : update when generic surveys are allowe
  1678       # TODO: update when generic surveys are allowe
  1679       return self.deny(django_args)
  1679       return self.deny(django_args)
  1680 
  1680 
  1681     survey = survey_logic.getFromKeyFieldsOr404(django_args)
  1681     survey = survey_logic.getFromKeyFieldsOr404(django_args)
  1682 
  1682 
  1683     if not timeline_helper.isActivePeriod(survey, 'survey'):
  1683     if not timeline_helper.isActivePeriod(survey, 'survey'):
  1684       raise out_of_band.AccessViolation(message_fmt=DEF_PAGE_INACTIVE_MSG)
  1684       raise out_of_band.AccessViolation(message_fmt=DEF_PAGE_INACTIVE_MSG)
  1685 
  1685 
  1686     role = survey.taking_access
  1686     role = survey.taking_access
  1687 
       
  1688     if role == 'public':
       
  1689       # TODO : are we sure we want public surveys?
       
  1690       return self.allow(django_args)
       
  1691 
  1687 
  1692     if role == 'user':
  1688     if role == 'user':
  1693       return self.checkIsUser(django_args)
  1689       return self.checkIsUser(django_args)
  1694 
  1690 
  1695     django_args = django_args.copy()
  1691     django_args = django_args.copy()