Skip to content

Commit 9f998e5

Browse files
committed
Tweaked code to correct access to document metadata and actions, adding RGs to the groups and group secretaries to the roles which are given access.
- Legacy-Id: 5935
1 parent b02d0bd commit 9f998e5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def document_main(request, name, rev=None):
141141
stream_slugs = StreamName.objects.values_list("slug", flat=True)
142142
can_change_stream = bool(can_edit or (
143143
request.user.is_authenticated() and
144-
Role.objects.filter(name__in=("chair", "secr", "auth"),
144+
Role.objects.filter(name__in=("chair", "secr", "auth", "delegate"),
145145
group__acronym__in=stream_slugs,
146146
person__user=request.user)))
147147
can_edit_iana_state = has_role(request.user, ("Secretariat", "IANA"))
@@ -282,8 +282,8 @@ def document_main(request, name, rev=None):
282282

283283
if ((not doc.stream_id or doc.stream_id in ("ietf", "irtf")) and group.type_id == "individ" and
284284
(request.user.is_authenticated() and
285-
Role.objects.filter(person__user=request.user, name__in=("chair", "delegate"),
286-
group__type__in=("wg",),
285+
Role.objects.filter(person__user=request.user, name__in=("chair", "secr", "delegate"),
286+
group__type__in=("wg","rg"),
287287
group__state="active")
288288
or has_role(request.user, "Secretariat"))):
289289
actions.append(("Adopt in Group", urlreverse('edit_adopt', kwargs=dict(name=doc.name))))

ietf/ietfauth/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def has_role(user, role_names):
5151
"IAB Chair": Q(person=person, name="chair", group__acronym="iab"),
5252
"WG Chair": Q(person=person,name="chair", group__type="wg", group__state="active"),
5353
"WG Secretary": Q(person=person,name="secr", group__type="wg", group__state="active"),
54+
"RG Chair": Q(person=person,name="chair", group__type="rg", group__state="active"),
55+
"RG Secretary": Q(person=person,name="secr", group__type="rg", group__state="active"),
5456
}
5557

5658
filter_expr = Q()

0 commit comments

Comments
 (0)