web: fix BoundPoliciesList not showing policy correctly

This commit is contained in:
Jens Langhammer 2021-02-28 10:19:19 +01:00
parent 9bb46ecb88
commit 30a1b65e94
2 changed files with 3 additions and 4 deletions

View file

@ -5,8 +5,7 @@ import { User } from "./Users";
export class PolicyBinding { export class PolicyBinding {
pk: string; pk: string;
policy: string; policy?: Policy;
policy_obj?: Policy;
group?: Group; group?: Group;
user?: User; user?: User;
target: string; target: string;

View file

@ -33,8 +33,8 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
} }
getPolicyUserGroupRow(item: PolicyBinding): string { getPolicyUserGroupRow(item: PolicyBinding): string {
if (item.policy_obj) { if (item.policy) {
return gettext(`Policy ${item.policy_obj.name}`); return gettext(`Policy ${item.policy.name}`);
} else if (item.group) { } else if (item.group) {
return gettext(`Group ${item.group.name}`); return gettext(`Group ${item.group.name}`);
} else if (item.user) { } else if (item.user) {