diff --git a/resources/scripts/components/server/users/EditSubuserModal.tsx b/resources/scripts/components/server/users/EditSubuserModal.tsx index 81fefcc7d..104684f23 100644 --- a/resources/scripts/components/server/users/EditSubuserModal.tsx +++ b/resources/scripts/components/server/users/EditSubuserModal.tsx @@ -53,6 +53,8 @@ const EditSubuserModal = forwardRef(({ 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(({ 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(({ subuser, ...pr } + {(!user.rootAdmin && loggedInPermissions[0] !== '*') &&

Only permissions which your account is currently assigned may be selected when creating or modifying other users.

+ } {!subuser &&