allow non admins to delete their clients

This commit is contained in:
Evert Prants 2022-09-14 20:44:18 +03:00
parent 6195f879db
commit 7e56e0eec4
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -312,7 +312,9 @@ export class OAuth2AdminController {
); );
} }
if (client.activated) { const isAdmin = this._service.userHasPrivilege(user, 'admin:oauth2');
if (client.activated && isAdmin) {
throw new BadRequestException('Please deactivate the client first.'); throw new BadRequestException('Please deactivate the client first.');
} }