From 30a1b65e94d890f08cd68bd80dc850716c479283 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 28 Feb 2021 10:19:19 +0100 Subject: [PATCH] web: fix BoundPoliciesList not showing policy correctly --- web/src/api/PolicyBindings.ts | 3 +-- web/src/elements/policies/BoundPoliciesList.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/api/PolicyBindings.ts b/web/src/api/PolicyBindings.ts index b8bc45f0d..ca54d85e8 100644 --- a/web/src/api/PolicyBindings.ts +++ b/web/src/api/PolicyBindings.ts @@ -5,8 +5,7 @@ import { User } from "./Users"; export class PolicyBinding { pk: string; - policy: string; - policy_obj?: Policy; + policy?: Policy; group?: Group; user?: User; target: string; diff --git a/web/src/elements/policies/BoundPoliciesList.ts b/web/src/elements/policies/BoundPoliciesList.ts index 1e33101e8..298bc2d28 100644 --- a/web/src/elements/policies/BoundPoliciesList.ts +++ b/web/src/elements/policies/BoundPoliciesList.ts @@ -33,8 +33,8 @@ export class BoundPoliciesList extends Table { } getPolicyUserGroupRow(item: PolicyBinding): string { - if (item.policy_obj) { - return gettext(`Policy ${item.policy_obj.name}`); + if (item.policy) { + return gettext(`Policy ${item.policy.name}`); } else if (item.group) { return gettext(`Group ${item.group.name}`); } else if (item.user) {