58 rights['create'] = ['checkIsDeveloper'] |
58 rights['create'] = ['checkIsDeveloper'] |
59 rights['edit'] = [('checkIsMyActiveRole', soc.logic.models.mentor.logic)] |
59 rights['edit'] = [('checkIsMyActiveRole', soc.logic.models.mentor.logic)] |
60 rights['delete'] = ['checkIsDeveloper'] |
60 rights['delete'] = ['checkIsDeveloper'] |
61 rights['invite'] = [('checkHasActiveRoleForScope', |
61 rights['invite'] = [('checkHasActiveRoleForScope', |
62 soc.logic.models.org_admin.logic)] |
62 soc.logic.models.org_admin.logic)] |
63 rights['accept_invite'] = [('checkCanCreateFromRequest', 'mentor'), |
63 rights['accept_invite'] = ['checkCanCreateFromRequest', |
64 ('checkIsNotStudentForProgramOfOrg', [org_logic.logic, |
64 ('checkIsNotStudentForProgramOfOrgInRequest',[org_logic.logic, |
65 student_logic.logic])] |
65 student_logic.logic])] |
66 rights['request'] = [ |
66 rights['request'] = [ |
67 ('checkIsNotStudentForProgramOfOrg', |
67 ('checkIsNotStudentForProgramOfOrg', |
68 [org_logic.logic, student_logic.logic]), |
68 [org_logic.logic, student_logic.logic]), |
69 ('checkCanMakeRequestToGroup', org_logic.logic)] |
69 ('checkCanMakeRequestToGroup', org_logic.logic)] |
70 rights['process_request'] = [ |
70 rights['process_request'] = [ |
71 ('checkHasActiveRoleForScope', soc.logic.models.org_admin.logic), |
71 ('checkCanProcessRequest', [[soc.logic.models.org_admin.logic]])] |
72 ('checkCanProcessRequest', 'mentor')] |
|
73 rights['manage'] = [ |
72 rights['manage'] = [ |
74 ('checkIsAllowedToManageRole', [soc.logic.models.mentor.logic, |
73 ('checkIsAllowedToManageRole', [soc.logic.models.mentor.logic, |
75 soc.logic.models.org_admin.logic])] |
74 soc.logic.models.org_admin.logic])] |
76 |
75 |
77 new_params = {} |
76 new_params = {} |
159 |
158 |
160 super(View, self)._editPost(request, entity, fields) |
159 super(View, self)._editPost(request, entity, fields) |
161 |
160 |
162 def _acceptInvitePost(self, fields, request, context, params, **kwargs): |
161 def _acceptInvitePost(self, fields, request, context, params, **kwargs): |
163 """Fills in the fields that were missing in the invited_created_form. |
162 """Fills in the fields that were missing in the invited_created_form. |
164 |
163 |
165 For params see base.View._acceptInvitePost() |
164 For params see base.View._acceptInvitePost() |
166 """ |
165 """ |
167 |
166 |
168 # fill in the appropriate fields that were missing in the form |
167 # fill in the appropriate fields that were missing in the form |
169 fields['user'] = fields['link_id'] |
|
170 fields['link_id'] = fields['user'].link_id |
|
171 fields['agreed_to_tos'] = fields['agreed_to_mentor_agreement'] |
168 fields['agreed_to_tos'] = fields['agreed_to_mentor_agreement'] |
172 |
169 |
173 group_logic = params['group_logic'] |
170 group_logic = params['group_logic'] |
174 group_entity = group_logic.getFromKeyName(fields['scope_path']) |
171 group_entity = group_logic.getFromKeyName(fields['scope_path']) |
175 fields['program'] = group_entity.scope |
172 fields['program'] = group_entity.scope |