Skip to content

Commit

Permalink
MG-2524 - Fix domain disable and list things (#2525)
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene authored Nov 13, 2024
1 parent 6d30528 commit 8b9ec40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions auth/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func (svc service) RetrieveDomain(ctx context.Context, token, id string) (Domain
return Domain{}, errors.Wrap(svcerr.ErrViewEntity, err)
}
if err = svc.Authorize(ctx, policies.Policy{
Subject: res.Subject,
Subject: EncodeDomainUserID(id, res.User),
SubjectType: policies.UserType,
SubjectKind: policies.UsersKind,
Object: id,
Expand Down Expand Up @@ -545,7 +545,7 @@ func (svc service) UpdateDomain(ctx context.Context, token, id string, d DomainR
return Domain{}, err
}
if err := svc.Authorize(ctx, policies.Policy{
Subject: key.User,
Subject: EncodeDomainUserID(id, key.User),
SubjectType: policies.UserType,
SubjectKind: policies.UsersKind,
Object: id,
Expand All @@ -568,7 +568,7 @@ func (svc service) ChangeDomainStatus(ctx context.Context, token, id string, d D
return Domain{}, errors.Wrap(svcerr.ErrAuthentication, err)
}
if err := svc.Authorize(ctx, policies.Policy{
Subject: key.User,
Subject: EncodeDomainUserID(id, key.User),
SubjectType: policies.UserType,
SubjectKind: policies.UsersKind,
Object: id,
Expand Down
2 changes: 1 addition & 1 deletion things/postgres/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (repo *clientRepo) SearchClients(ctx context.Context, pm things.Page) (thin
tq := query
query = applyOrdering(query, pm)

q := fmt.Sprintf(`SELECT c.id, c.name, c.created_at, c.updated_at FROM clients c %s LIMIT :limit OFFSET :offset;`, query)
q := fmt.Sprintf(`SELECT c.id, c.name, c.tags, c.created_at, c.updated_at FROM clients c %s LIMIT :limit OFFSET :offset;`, query)

dbPage, err := ToDBClientsPage(pm)
if err != nil {
Expand Down

0 comments on commit 8b9ec40

Please sign in to comment.