Skip to content

Commit b2dbb1c

Browse files
committed
Merged in [10343] from housley@vigilsec.com:
Add check to addcomment for WG/RG chair or secretary; - Legacy-Id: 10356 Note: SVN reference [10343] has been migrated to Git commit 93568b2
2 parents 7baf20c + 93568b2 commit b2dbb1c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,18 @@ def add_comment(request, name):
905905

906906
login = request.user.person
907907

908+
if doc.type_id == "draft" and doc.group != None:
909+
can_add_comment = bool(has_role(request.user, ("Area Director", "Secretariat", "IRTF Chair", "IANA", "RFC Editor")) or (
910+
request.user.is_authenticated() and
911+
Role.objects.filter(name__in=("chair", "secr"),
912+
group__acronym=doc.group.acronym,
913+
person__user=request.user)))
914+
else:
915+
can_add_comment = has_role(request.user, ("Area Director", "Secretariat", "IRTF Chair"))
916+
if not can_add_comment:
917+
# The user is a chair or secretary, but not for this WG or RG
918+
return HttpResponseForbidden("You need to be a chair or secretary of this group to add a comment.")
919+
908920
if request.method == 'POST':
909921
form = AddCommentForm(request.POST)
910922
if form.is_valid():

0 commit comments

Comments
 (0)