mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(rbac): detect if rbac is enabled [EE-4308] (#8139)
This commit is contained in:
parent
8dcc5e4adb
commit
c1cc8bad77
10 changed files with 327 additions and 6 deletions
14
app/react/kubernetes/cluster/service.ts
Normal file
14
app/react/kubernetes/cluster/service.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import PortainerError from '@/portainer/error';
|
||||
import axios from '@/portainer/services/axios';
|
||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||
|
||||
export async function getIsRBACEnabled(environmentId: EnvironmentId) {
|
||||
try {
|
||||
const { data } = await axios.get(
|
||||
`kubernetes/${environmentId}/rbac_enabled`
|
||||
);
|
||||
return data;
|
||||
} catch (e) {
|
||||
throw new PortainerError('Unable to check if RBAC is enabled.', e as Error);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue