From 341a7b20345e0b0eb07c0a2f52c8cc03c364607c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 30 Nov 2022 15:26:16 +0100 Subject: [PATCH] fix bug privacity --- ereuse_devicehub/inventory/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index a9b44d50..b9c3a659 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -141,6 +141,7 @@ class ErasureListView(DeviceListMixin): ) if orphans: schema = app.config.get('SCHEMA') + _user = g.user.id sql = f""" select action.id from {schema}.action as action inner join {schema}.erase_basic as erase @@ -149,7 +150,8 @@ class ErasureListView(DeviceListMixin): on device.id=action.parent_id inner join {schema}.placeholder as placeholder on placeholder.binding_id=device.id - where action.parent_id is null or placeholder.kangaroo=true + where (action.parent_id is null or placeholder.kangaroo=true) + and action.author_id='{_user}' """ ids = (e[0] for e in db.session.execute(sql)) erasure = (