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

fix: should only require CREATE_ADDON when creating addon (#2204)

This commit is contained in:
Ivar Conradi Østhus 2022-10-18 19:58:05 +02:00 committed by GitHub
parent 5c6fce0f98
commit bd4e648eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,10 @@ import { AddonMultiSelector } from './AddonMultiSelector/AddonMultiSelector';
import FormTemplate from 'component/common/FormTemplate/FormTemplate';
import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig';
import PermissionButton from '../../common/PermissionButton/PermissionButton';
import { ADMIN } from '../../providers/AccessProvider/permissions';
import {
CREATE_ADDON,
UPDATE_ADDON,
} from '../../providers/AccessProvider/permissions';
import {
StyledForm,
StyledFormSection,
@ -334,7 +337,7 @@ export const AddonForm: VFC<IAddonFormProps> = ({
type="submit"
color="primary"
variant="contained"
permission={ADMIN}
permission={editMode ? UPDATE_ADDON : CREATE_ADDON}
>
{submitText}
</PermissionButton>