Merge branch 'develop' into showunlimited
This commit is contained in:
commit
4d3563b8e1
7 changed files with 54 additions and 54 deletions
|
@ -17,14 +17,14 @@ const chartDefaults: ChartConfiguration = {
|
|||
enabled: false,
|
||||
},
|
||||
animation: {
|
||||
duration: 250,
|
||||
duration: 0,
|
||||
},
|
||||
elements: {
|
||||
point: {
|
||||
radius: 0,
|
||||
},
|
||||
line: {
|
||||
tension: 0.1,
|
||||
tension: 0.3,
|
||||
backgroundColor: 'rgba(15, 178, 184, 0.45)',
|
||||
borderColor: '#32D0D9',
|
||||
},
|
||||
|
|
|
@ -53,6 +53,8 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
|
|||
const [ canEditUser ] = usePermissions(subuser ? [ 'user.update' ] : [ 'user.create' ]);
|
||||
const permissions = useStoreState(state => state.permissions.data);
|
||||
|
||||
const user = useStoreState(state => state.user.data!);
|
||||
|
||||
// The currently logged in user's permissions. We're going to filter out any permissions
|
||||
// that they should not need.
|
||||
const loggedInPermissions = ServerContext.useStoreState(state => state.server.permissions);
|
||||
|
@ -64,7 +66,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
|
|||
|
||||
const list: string[] = ([] as string[]).concat.apply([], Object.values(cleaned));
|
||||
|
||||
if (loggedInPermissions.length === 1 && loggedInPermissions[0] === '*') {
|
||||
if (user.rootAdmin || (loggedInPermissions.length === 1 && loggedInPermissions[0] === '*')) {
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -81,12 +83,14 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
|
|||
}
|
||||
</h3>
|
||||
<FlashMessageRender byKey={'user:edit'} className={'mt-4'}/>
|
||||
{(!user.rootAdmin && loggedInPermissions[0] !== '*') &&
|
||||
<div className={'mt-4 pl-4 py-2 border-l-4 border-cyan-400'}>
|
||||
<p className={'text-sm text-neutral-300'}>
|
||||
Only permissions which your account is currently assigned may be selected when creating or
|
||||
modifying other users.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
{!subuser &&
|
||||
<div className={'mt-6'}>
|
||||
<Field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue