mirror of https://github.com/CIRCL/AIL-framework
fix: [Tracker] edit tracker ACL
parent
4fa320741c
commit
78903ec033
|
@ -183,7 +183,7 @@ def api_is_allowed_to_edit_tracker(tracker_uuid, user_id):
|
||||||
tracker_creator = r_serv_tracker.hget('tracker:{}'.format(tracker_uuid), 'user_id')
|
tracker_creator = r_serv_tracker.hget('tracker:{}'.format(tracker_uuid), 'user_id')
|
||||||
if not tracker_creator:
|
if not tracker_creator:
|
||||||
return ({"status": "error", "reason": "Unknown uuid"}, 404)
|
return ({"status": "error", "reason": "Unknown uuid"}, 404)
|
||||||
if not is_in_role(user_id, 'admin') or user_id != tracker_creator:
|
if not is_in_role(user_id, 'admin') and user_id != tracker_creator:
|
||||||
return ({"status": "error", "reason": "Access Denied"}, 403)
|
return ({"status": "error", "reason": "Access Denied"}, 403)
|
||||||
return ({"uuid": tracker_uuid}, 200)
|
return ({"uuid": tracker_uuid}, 200)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue