Changed the ietfauth file to allow to change the replaces relationship without setting the doc stream. Fixes ticket #1305. Commit ready for merge.

- Legacy-Id: 8146
This commit is contained in:
Sun Qi 2014-07-19 21:45:40 +00:00
parent dac3efcb68
commit 03711ef538

View file

@ -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