Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Disable permission checks for GetAccount (entirely) and ListAcccounts…
Browse files Browse the repository at this point in the history
… (when having a query)
  • Loading branch information
kulmann committed Sep 3, 2020
1 parent 77f6205 commit f6b8044
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/service/v0/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (s Service) hasAccountManagementPermissions(ctx context.Context) bool {
// ListAccounts implements the AccountsServiceHandler interface
// the query contains account properties
func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest, out *proto.ListAccountsResponse) (err error) {
if !s.hasAccountManagementPermissions(ctx) {
if len(in.Query) == 0 && !s.hasAccountManagementPermissions(ctx) {
return merrors.Forbidden(s.id, "no permission for ListAccounts")
}

Expand Down Expand Up @@ -266,10 +266,6 @@ func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest

// GetAccount implements the AccountsServiceHandler interface
func (s Service) GetAccount(ctx context.Context, in *proto.GetAccountRequest, out *proto.Account) (err error) {
if !s.hasAccountManagementPermissions(ctx) {
return merrors.Forbidden(s.id, "no permission for GetAccount")
}

accLock.Lock()
defer accLock.Unlock()
var id string
Expand Down

0 comments on commit f6b8044

Please sign in to comment.