catalog-backend: rename permission-related variable to match type

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2022-01-13 13:30:08 +00:00
parent 0ae4f4cc82
commit 12f5c33043
2 changed files with 6 additions and 6 deletions
@@ -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);