Skip to content

Commit

Permalink
fix: only show irtf stream ballot and publication buttons to the IRTF…
Browse files Browse the repository at this point in the history
… chair (#5036)
  • Loading branch information
rjsparks authored Jan 25, 2023
1 parent 742fc4e commit 5560c28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ietf/doc/views_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,22 +390,22 @@ def document_main(request, name, rev=None, document_html=False):
if doc.get_state_slug() == "expired" and has_role(request.user, ("Secretariat",)) and not snapshot:
actions.append(("Resurrect", urlreverse('ietf.doc.views_draft.resurrect', kwargs=dict(name=doc.name))))

if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and not doc.ballot_open('irsg-approve') and can_edit_stream_info):
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and not doc.ballot_open('irsg-approve') and has_role(request.user, ("Secretariat", "IRTF Chair"))):
label = "Issue IRSG Ballot"
actions.append((label, urlreverse('ietf.doc.views_ballot.issue_irsg_ballot', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and doc.ballot_open('irsg-approve') and can_edit_stream_info):
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and doc.ballot_open('irsg-approve') and has_role(request.user, ("Secretariat", "IRTF Chair"))):
label = "Close IRSG Ballot"
actions.append((label, urlreverse('ietf.doc.views_ballot.close_irsg_ballot', kwargs=dict(name=doc.name))))

if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ise", "irtf")
and can_edit_stream_info and not conflict_reviews and not snapshot):
and has_role(request.user, ("Secretariat", "IRTF Chair")) and not conflict_reviews and not snapshot):
label = "Begin IETF Conflict Review"
if not doc.intended_std_level:
label += " (note that intended status is not set)"
actions.append((label, urlreverse('ietf.doc.views_conflict_review.start_review', kwargs=dict(name=doc.name))))

if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("iab", "ise", "irtf")
and can_edit_stream_info and not snapshot):
and (has_role(request.user, ("Secretariat", "IRTF Chair")) if doc.stream_id=="irtf" else can_edit_stream_info) and not snapshot):
if doc.get_state_slug('draft-stream-%s' % doc.stream_id) not in ('rfc-edit', 'pub', 'dead'):
label = "Request Publication"
if not doc.intended_std_level:
Expand Down
5 changes: 4 additions & 1 deletion ietf/doc/views_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,10 @@ class PublicationForm(forms.Form):

doc = get_object_or_404(Document, type="draft", name=name, stream__in=("iab", "ise", "irtf"))

if not is_authorized_in_doc_stream(request.user, doc):
if doc.stream_id == "irtf":
if not has_role(request.user, ("Secretariat", "IRTF Chair")):
permission_denied(request, "You do not have the necessary permissions to view this page.")
elif not is_authorized_in_doc_stream(request.user, doc):
permission_denied(request, "You do not have the necessary permissions to view this page.")

consensus_event = doc.latest_event(ConsensusDocEvent, type="changed_consensus")
Expand Down

0 comments on commit 5560c28

Please sign in to comment.