mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
remove isClusterAdmin call
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
b171524e49
commit
ed2ba5baf6
2 files changed
+13
-3
No files matched your search
@@ -1,6 +1,15 @@
|
||||
import { configStore } from "../config.store";
|
||||
import { isArray } from "util";
|
||||
|
||||
export function isAllowedResource(resource: string) {
|
||||
export function isAllowedResource(resources: string|string[]) {
|
||||
if (!isArray(resources)) {
|
||||
resources = [resources];
|
||||
}
|
||||
const { allowedResources } = configStore;
|
||||
return allowedResources.includes(resource)
|
||||
for (const resource of resources) {
|
||||
if (!allowedResources.includes(resource)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user