mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Replace admin check with check for access (#297)
Signed-off-by: Adam Malcontenti-Wilson <adman.com@gmail.com>
This commit is contained in:
1 parent
fb287c435c
commit
e21e0b577b
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,
|
||||
|
||||
Reference in new issue
Block a user