From f7ba1557cf1e5132dc6391c0c60d6d550a06cf97 Mon Sep 17 00:00:00 2001 From: b1ackd0t Date: Thu, 13 Jul 2023 13:14:39 +0300 Subject: [PATCH] NOISSUE - Fix List Users Shared With Me and Mine (#1844) Signed-off-by: rodneyosodo --- users/clients/postgres/clients.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/clients/postgres/clients.go b/users/clients/postgres/clients.go index 1678e90f..8e25fd97 100644 --- a/users/clients/postgres/clients.go +++ b/users/clients/postgres/clients.go @@ -439,7 +439,7 @@ func pageQuery(pm mfclients.Page) (string, error) { // For listing clients that the specified client owns and that are shared with the specified client if pm.Owner != "" && pm.SharedBy != "" { - query = append(query, "(c.owner_id = :owner_id OR EXISTS (SELECT 1 FROM policies WHERE subject = :shared_by AND :action=ANY(actions) AND object = policies.object))") + query = append(query, "(c.owner_id = :owner_id OR (policies.object IN (SELECT object FROM policies WHERE subject = :shared_by AND :action=ANY(actions))))") } // For listing clients that the specified client is shared with if pm.SharedBy != "" && pm.Owner == "" {