Skip to content

Commit

Permalink
Changed the ietfauth file to allow to change the replaces relationshi…
Browse files Browse the repository at this point in the history
…p without setting the doc stream. Fixes ticket #1305. Commit ready for merge.

 - Legacy-Id: 8146
  • Loading branch information
Sun Qi committed Jul 19, 2014
1 parent dac3efc commit 03711ef
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ietf/ietfauth/utils.py
Expand Up @@ -100,9 +100,23 @@ def is_authorized_in_doc_stream(user, doc):
document."""
if has_role(user, ["Secretariat"]):
return True

'''
if not doc.stream or not user.is_authenticated():
return False
'''

if not user.is_authenticated():
return False

if not doc.stream:
group_req = None
if has_role(user, ["Area Director"]):
return True
if not doc.group.type == "individ":
group_req = Q(group=doc.group)
if not group_req:
return False
return bool(Role.objects.filter(Q(name__in=("chair", "secr", "delegate", "auth"), person__user=user) & group_req))

# must be authorized in the stream or group

Expand Down

0 comments on commit 03711ef

Please sign in to comment.