NOISSUE - Fix List Users Shared With Me and Mine (#1844)

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
This commit is contained in:
b1ackd0t 2023-07-13 13:14:39 +03:00 committed by GitHub
parent 031e0a62f2
commit f7ba1557cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 == "" {