Support future compatibility for permissions
Co-authored by: Vincenzo Scamporlino <vincenzos@spotify.com> Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
This commit is contained in:
@@ -42,8 +42,8 @@ export async function requirePermission(
|
||||
)
|
||||
)[0];
|
||||
|
||||
if (decision.result === AuthorizeResult.DENY) {
|
||||
const err = new NotAllowedError('Unauthorized');
|
||||
throw err;
|
||||
if (decision.result === AuthorizeResult.ALLOW) {
|
||||
return;
|
||||
}
|
||||
throw new NotAllowedError('Unauthorized');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user