Allow IRTF chair to adopt a draft into any RG.
Fixes #1082. Commit ready for merge. - Legacy-Id: 8143
This commit is contained in:
parent
dac3efcb68
commit
e9c79a9e19
|
@ -54,6 +54,11 @@ def can_adopt_draft(user, doc):
|
|||
if has_role(user, "Secretariat"):
|
||||
return True
|
||||
|
||||
#The IRTF chair can adopt a draft into any RG
|
||||
if has_role(user, "IRTF Chair"):
|
||||
return (doc.stream_id in (None, "irtf")
|
||||
and doc.group.type_id == "individ")
|
||||
|
||||
return (doc.stream_id in (None, "ietf", "irtf")
|
||||
and doc.group.type_id == "individ"
|
||||
and Role.objects.filter(name__in=("chair", "delegate", "secr"),
|
||||
|
|
|
@ -1276,6 +1276,11 @@ class AdoptDraftForm(forms.Form):
|
|||
|
||||
if has_role(user, "Secretariat"):
|
||||
pass # all groups
|
||||
elif has_role(user, "IRTF Chair"):
|
||||
#The IRTF chair can adopt a draft into any RG
|
||||
group_ids = list(Group.objects.filter(type="rg", state="active").values_list('id', flat=True))
|
||||
group_ids.extend(list(Group.objects.filter(type="wg", state="active", role__person__user=user, role__name__in=("chair", "delegate", "secr")).values_list('id', flat=True)))
|
||||
self.fields["group"].queryset = self.fields["group"].queryset.filter(id__in=group_ids).distinct()
|
||||
else:
|
||||
self.fields["group"].queryset = self.fields["group"].queryset.filter(role__person__user=user, role__name__in=("chair", "delegate", "secr")).distinct()
|
||||
|
||||
|
|
Loading…
Reference in a new issue