Replace admin check with check for access

Signed-off-by: Adam Malcontenti-Wilson <adman.com@gmail.com>
This commit is contained in:
Adam Malcontenti-Wilson committed 2020-05-07 15:38:43 +10:00
1 parent 3a92e5d3ab
commit 47d43ddcef
9 files changed
+62 -58

No files matched your search

@@ -21,7 +21,7 @@ interface Props extends RouteComponentProps<{}> {
export class UserManagement extends React.Component<Props> {
static get tabRoutes() {
const tabRoutes: TabRoute[] = [];
const { isClusterAdmin } = configStore;
const { allowedResources } = configStore;
const query = namespaceStore.getContextParams()
tabRoutes.push(
{
@@ -43,7 +43,7 @@ export class UserManagement extends React.Component<Props> {
path: rolesRoute.path,
},
)
if (isClusterAdmin) {
if (allowedResources.includes("podsecuritypolicies")) {
tabRoutes.push({
title: <Trans>Pod Security Policies</Trans>,
component: PodSecurityPolicies,