catalog-backend: rename permission-related variable to match type
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -36,23 +36,23 @@ export class AuthorizedEntitiesCatalog implements EntitiesCatalog {
|
||||
) {}
|
||||
|
||||
async entities(request?: EntitiesRequest): Promise<EntitiesResponse> {
|
||||
const authorizeResponse = (
|
||||
const authorizeDecision = (
|
||||
await this.permissionApi.authorize(
|
||||
[{ permission: catalogEntityReadPermission }],
|
||||
{ token: request?.authorizationToken },
|
||||
)
|
||||
)[0];
|
||||
|
||||
if (authorizeResponse.result === AuthorizeResult.DENY) {
|
||||
if (authorizeDecision.result === AuthorizeResult.DENY) {
|
||||
return {
|
||||
entities: [],
|
||||
pageInfo: { hasNextPage: false },
|
||||
};
|
||||
}
|
||||
|
||||
if (authorizeResponse.result === AuthorizeResult.CONDITIONAL) {
|
||||
if (authorizeDecision.result === AuthorizeResult.CONDITIONAL) {
|
||||
const permissionFilter: EntityFilter = this.transformConditions(
|
||||
authorizeResponse.conditions,
|
||||
authorizeDecision.conditions,
|
||||
);
|
||||
return this.entitiesCatalog.entities({
|
||||
...request,
|
||||
|
||||
@@ -28,7 +28,7 @@ export class AuthorizedRefreshService implements RefreshService {
|
||||
) {}
|
||||
|
||||
async refresh(options: RefreshOptions) {
|
||||
const authorizeResponse = (
|
||||
const authorizeDecision = (
|
||||
await this.permissionApi.authorize(
|
||||
[
|
||||
{
|
||||
@@ -39,7 +39,7 @@ export class AuthorizedRefreshService implements RefreshService {
|
||||
{ token: options.authorizationToken },
|
||||
)
|
||||
)[0];
|
||||
if (authorizeResponse.result !== AuthorizeResult.ALLOW) {
|
||||
if (authorizeDecision.result !== AuthorizeResult.ALLOW) {
|
||||
throw new NotAllowedError();
|
||||
}
|
||||
await this.service.refresh(options);
|
||||
|
||||
Reference in New Issue
Block a user