1696 django_args['program'] = survey_scope |
1696 django_args['program'] = survey_scope |
1697 # program is the 'program' attribute for mentors and org_admins |
1697 # program is the 'program' attribute for mentors and org_admins |
1698 return self._checkHasActiveRoleFor(django_args, mentor_logic, 'program') |
1698 return self._checkHasActiveRoleFor(django_args, mentor_logic, 'program') |
1699 |
1699 |
1700 if role == 'org_admin': |
1700 if role == 'org_admin': |
1701 # check if the current user is a mentor for the program in survey.scope |
1701 # check if the current user is an org admin for the program |
1702 django_args['program'] = survey_scope |
1702 django_args['program'] = survey_scope |
1703 # program is the 'program' attribute for mentors and org_admins |
1703 # program is the 'program' attribute for mentors and org_admins |
1704 return self._checkHasActiveRoleFor(django_args, org_admin_logic, |
1704 return self._checkHasActiveRoleFor(django_args, org_admin_logic, |
1705 'program') |
1705 'program') |
|
1706 |
|
1707 if role == 'org': |
|
1708 # check if the current user is an org admin or mentor for the program |
|
1709 django_args['program'] = survey_scope |
|
1710 |
|
1711 try: |
|
1712 # program is the 'program' attribute for mentors and org_admins |
|
1713 return self._checkHasActiveRoleFor(django_args, org_admin_logic, |
|
1714 'program') |
|
1715 except: |
|
1716 # the current user is no org admin |
|
1717 pass |
|
1718 |
|
1719 # try to check if the current user is a mentor instead |
|
1720 return self._checkHasActiveRoleFor(django_args, mentor_logic, 'program') |
1706 |
1721 |
1707 if role == 'student': |
1722 if role == 'student': |
1708 # check if the current user is a student for the program in survey.scope |
1723 # check if the current user is a student for the program in survey.scope |
1709 django_args['scope'] = survey_scope |
1724 django_args['scope'] = survey_scope |
1710 # program is the 'scope' attribute for students |
1725 # program is the 'scope' attribute for students |