Skip to content

Commit de7ee4e

Browse files
committed
is: Impose support user rights limitation on GetAccessToken operation
1 parent 4c69dbd commit de7ee4e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/identityserver/bunstore/oauth_store.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,11 @@ func (s *oauthStore) GetAccessToken(ctx context.Context, id string) (*ttnpb.OAut
685685
return nil, err
686686
}
687687

688+
// NOTE: This imposes a limitation on the client's rights if the token's user is the unique support user.
689+
if model.User.Account.UID == ttnpb.SupportUserID {
690+
model.Rights = convertIntSlice[ttnpb.Right, int](ttnpb.AllReadAdminRights.GetRights())
691+
}
692+
688693
pb, err := accessTokenToPB(model, nil, nil)
689694
if err != nil {
690695
return nil, err

0 commit comments

Comments
 (0)