Allow user and admin attribute permissions to be independantly set (#3472)

This commit is contained in:
Michael Bischof 2022-10-21 17:09:46 +02:00 committed by GitHub
parent 2bd2a28c80
commit cc59f1547d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,11 +28,10 @@ const Permissions = ({ name }: { name: string }) => {
const option = "user"; const option = "user";
const changedValue = value.includes(option) const changedValue = value.includes(option)
? value.filter((item: string) => item !== option) ? value.filter((item: string) => item !== option)
: [option]; : [...value, option];
onChange(changedValue); onChange(changedValue);
}} }}
isDisabled={value.includes("admin")}
/> />
</GridItem> </GridItem>
<GridItem lg={8} sm={6}> <GridItem lg={8} sm={6}>
@ -46,7 +45,7 @@ const Permissions = ({ name }: { name: string }) => {
const option = "admin"; const option = "admin";
const changedValue = value.includes(option) const changedValue = value.includes(option)
? value.filter((item: string) => item !== option) ? value.filter((item: string) => item !== option)
: ["user", option]; : [...value, option];
onChange(changedValue); onChange(changedValue);
}} }}