Merge branch 'master' into remove-apidoc-comments
This commit is contained in:
commit
a669712d0c
|
@ -39,7 +39,15 @@
|
||||||
allowCreator
|
allowCreator
|
||||||
) => {
|
) => {
|
||||||
if (allowedRoles?.length) {
|
if (allowedRoles?.length) {
|
||||||
return roles.filter(role => allowedRoles.includes(role._id))
|
const filteredRoles = roles.filter(role =>
|
||||||
|
allowedRoles.includes(role._id)
|
||||||
|
)
|
||||||
|
return [
|
||||||
|
...filteredRoles,
|
||||||
|
...(allowedRoles.includes(Constants.Roles.CREATOR)
|
||||||
|
? [{ _id: Constants.Roles.CREATOR, name: "Creator", enabled: false }]
|
||||||
|
: []),
|
||||||
|
]
|
||||||
}
|
}
|
||||||
let newRoles = [...roles]
|
let newRoles = [...roles]
|
||||||
|
|
||||||
|
@ -129,8 +137,9 @@
|
||||||
getOptionColour={getColor}
|
getOptionColour={getColor}
|
||||||
getOptionIcon={getIcon}
|
getOptionIcon={getIcon}
|
||||||
isOptionEnabled={option =>
|
isOptionEnabled={option =>
|
||||||
option._id !== Constants.Roles.CREATOR ||
|
(option._id !== Constants.Roles.CREATOR ||
|
||||||
$licensing.perAppBuildersEnabled}
|
$licensing.perAppBuildersEnabled) &&
|
||||||
|
option.enabled !== false}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
{error}
|
{error}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -516,6 +516,13 @@
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const parseRole = user => {
|
||||||
|
if (user.isAdminOrGlobalBuilder) {
|
||||||
|
return Constants.Roles.CREATOR
|
||||||
|
}
|
||||||
|
return user.role
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window on:keydown={handleKeyDown} />
|
<svelte:window on:keydown={handleKeyDown} />
|
||||||
|
@ -725,7 +732,7 @@
|
||||||
<RoleSelect
|
<RoleSelect
|
||||||
footer={getRoleFooter(user)}
|
footer={getRoleFooter(user)}
|
||||||
placeholder={false}
|
placeholder={false}
|
||||||
value={user.role}
|
value={parseRole(user)}
|
||||||
allowRemove={user.role && !user.group}
|
allowRemove={user.role && !user.group}
|
||||||
allowPublic={false}
|
allowPublic={false}
|
||||||
allowCreator={true}
|
allowCreator={true}
|
||||||
|
@ -744,7 +751,7 @@
|
||||||
autoWidth
|
autoWidth
|
||||||
align="right"
|
align="right"
|
||||||
allowedRoles={user.isAdminOrGlobalBuilder
|
allowedRoles={user.isAdminOrGlobalBuilder
|
||||||
? [Constants.Roles.ADMIN]
|
? [Constants.Roles.CREATOR]
|
||||||
: null}
|
: null}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue