1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: set admin permission (#736)

This commit is contained in:
Fredrik Strand Oseberg 2022-02-23 13:47:32 +01:00 committed by GitHub
parent 9e0eec10ba
commit 38c26ec052
3 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,8 @@ import EnvironmentListItem from './EnvironmentListItem/EnvironmentListItem';
import { mutate } from 'swr';
import EnvironmentToggleConfirm from './EnvironmentToggleConfirm/EnvironmentToggleConfirm';
import useProjectRolePermissions from '../../../hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
import { ADMIN } from 'component/providers/AccessProvider/permissions';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
const EnvironmentList = () => {
const defaultEnv = {
@ -30,6 +32,7 @@ const EnvironmentList = () => {
protected: false,
};
const { environments, refetch } = useEnvironments();
const { uiConfig } = useUiConfig();
const { refetch: refetchProjectRolePermissions } =
useProjectRolePermissions();
@ -161,7 +164,6 @@ const EnvironmentList = () => {
const navigateToCreateEnvironment = () => {
history.push('/environments/create');
};
return (
<PageContent
headerContent={
@ -174,6 +176,8 @@ const EnvironmentList = () => {
maxWidth="700px"
tooltip="Add environment"
Icon={Add}
permission={ADMIN}
disabled={!Boolean(uiConfig.flags.EEA)}
>
Add Environment
</ResponsiveButton>

View File

@ -5,7 +5,7 @@ export const defaultValue = {
version: '3.x',
environment: '',
slogan: 'The enterprise ready feature toggle service.',
flags: { P: false, C: false, E: false, RE: false },
flags: { P: false, C: false, E: false, RE: false, EEA: false },
links: [
{
value: 'Documentation',

View File

@ -24,6 +24,8 @@ export interface IFlags {
P: boolean;
E: boolean;
RE: boolean;
EEA?: boolean;
OIDC?: boolean;
}
export interface IVersionInfo {