Skip to content

Commit

Permalink
Use normal material management permissions for uploading bluesheets. F…
Browse files Browse the repository at this point in the history
…ixes #2975. Commit ready for merge.

 - Legacy-Id: 17724
  • Loading branch information
rjsparks committed May 1, 2020
1 parent 9b14d17 commit 139bcc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ietf/meeting/tests_views.py
Expand Up @@ -2368,7 +2368,7 @@ def test_upload_bluesheets_interim(self):
def test_upload_bluesheets_interim_chair_access(self):
make_meeting_test_data()
mars = Group.objects.get(acronym='mars')
session=SessionFactory(meeting__type_id='interim',group=mars)
session=SessionFactory(meeting__type_id='interim',group=mars, meeting__date = datetime.date.today())
url = urlreverse('ietf.meeting.views.upload_session_bluesheets',kwargs={'num':session.meeting.number,'session_id':session.id})
self.client.login(username="marschairman", password="marschairman+password")
r = self.client.get(url)
Expand Down
6 changes: 5 additions & 1 deletion ietf/meeting/views.py
Expand Up @@ -1645,11 +1645,15 @@ def __init__(self, *args, **kwargs):
super(UploadBlueSheetForm, self).__init__(*args, **kwargs )


@role_required('Area Director', 'Secretariat', 'IRTF Chair', 'WG Chair', 'RG Chair')
def upload_session_bluesheets(request, session_id, num):
# num is redundant, but we're dragging it along an artifact of where we are in the current URL structure
session = get_object_or_404(Session,pk=session_id)

if not session.can_manage_materials(request.user):
return HttpResponseForbidden("You don't have permission to upload bluesheets for this session.")
if session.is_material_submission_cutoff() and not has_role(request.user, "Secretariat"):
return HttpResponseForbidden("The materials cutoff for this session has passed. Contact the secretariat for further action.")

if session.meeting.type.slug == 'ietf' and not has_role(request.user, 'Secretariat'):
return HttpResponseForbidden('Restricted to role Secretariat')

Expand Down

0 comments on commit 139bcc1

Please sign in to comment.