From bd4e648eaeb49fab2fe30e4829d629955169d8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 18 Oct 2022 19:58:05 +0200 Subject: [PATCH] fix: should only require CREATE_ADDON when creating addon (#2204) --- frontend/src/component/addons/AddonForm/AddonForm.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/addons/AddonForm/AddonForm.tsx b/frontend/src/component/addons/AddonForm/AddonForm.tsx index cfafd7fab2..47059e0cb4 100644 --- a/frontend/src/component/addons/AddonForm/AddonForm.tsx +++ b/frontend/src/component/addons/AddonForm/AddonForm.tsx @@ -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 = ({ type="submit" color="primary" variant="contained" - permission={ADMIN} + permission={editMode ? UPDATE_ADDON : CREATE_ADDON} > {submitText}