diff --git a/auth/postgres/domains.go b/auth/postgres/domains.go index 118163ae88..0048e33602 100644 --- a/auth/postgres/domains.go +++ b/auth/postgres/domains.go @@ -575,7 +575,7 @@ func buildPageQuery(pm auth.Page) (string, error) { query = append(query, "pc.subject_id = :subject_id") } - if pm.Permission != "" { + if pm.Permission != "" && pm.SubjectID != "" { query = append(query, "pc.relation = :permission") }