mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
refactoring & moving rbac.ts to "common"
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
3a115ae485
commit
39316e1a54
15 files changed
+62
-52
No files matched your search
@@ -1,16 +0,0 @@
|
||||
import { getHostedCluster } from "../../common/cluster-store";
|
||||
|
||||
// todo: refactor / move to cluster-store.ts?
|
||||
|
||||
export function isAllowedResource(resources: string | string[]) {
|
||||
if (!Array.isArray(resources)) {
|
||||
resources = [resources];
|
||||
}
|
||||
const { allowedResources = [] } = getHostedCluster() || {};
|
||||
for (const resource of resources) {
|
||||
if (!allowedResources.includes(resource)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user