1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00
portainer/app/react/kubernetes/cluster/getIsRBACEnabled.ts

15 lines
469 B
TypeScript
Raw Normal View History

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<boolean>(
`kubernetes/${environmentId}/rbac_enabled`
);
return data;
} catch (e) {
throw new PortainerError('Unable to check if RBAC is enabled.', e as Error);
}
}