Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
add: comments
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindh <[email protected]>
  • Loading branch information
arvindh123 committed Nov 27, 2023
1 parent 4a8f4dd commit ee60461
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions auth/postgres/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func (repo domainRepo) ListDomains(ctx context.Context, pm auth.Page) (auth.Doma
JOIN policies pc
ON pc.object_id = d.id`

// The service sends the user ID in the pagemeta subject field, which filters domains by joining with the policies table.
// For SuperAdmins, access to domains is granted without the policies filter.
// If the user making the request is a super admin, the service will assign an empty value to the pagemeta subject field.
// In the repository, when the pagemeta subject is empty, the query should be constructed without applying the policies filter.
if pm.SubjectID == "" {
q = `SELECT d.id as id, d.name as name, d.tags as tags, d.alias as alias, d.metadata as metadata, d.created_at as created_at, d.updated_at as updated_at, d.updated_by as updated_by, d.created_by as created_by, d.status as status
FROM domains as d`
Expand Down

0 comments on commit ee60461

Please sign in to comment.