chg: [trackers] check acl of last trackers matches

This commit is contained in:
terrtia 2024-09-11 17:27:05 +02:00
parent aecfa59185
commit d8724fa96e
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -777,11 +777,13 @@ def get_trackers_graph_by_day(l_trackers, num_day=31, date_from=None, date_to=No
list_tracker_stats.append({"name": tracker.get_tracked(), "Data": dict_tracker_data})
return list_tracker_stats
def get_trackers_dashboard():
def get_trackers_dashboard(user_org, user_id):
trackers = []
for raw in r_tracker.lrange('trackers:dashboard', 0, -1):
tracker_uuid, timestamp, obj_type, subtype, obj_id = raw.split(':', 4)
tracker = Tracker(tracker_uuid)
if not Tracker.check_level(user_org, user_id):
continue
meta = tracker.get_meta(options={'description', 'tags'})
if not meta.get('type'):
meta['type'] = 'Tracker DELETED'