diff --git a/src/components/UserList/index.tsx b/src/components/UserList/index.tsx index ebe88b3af..e9be2cdf9 100644 --- a/src/components/UserList/index.tsx +++ b/src/components/UserList/index.tsx @@ -32,13 +32,14 @@ const messages = defineMessages({ '{userCount, plural, =0 {No new users} one {# new user} other {# new users}} imported from Plex.', user: 'User', totalrequests: 'Total Requests', - usertype: 'User Type', + accounttype: 'Account Type', role: 'Role', created: 'Created', lastupdated: 'Last Updated', edit: 'Edit', bulkedit: 'Bulk Edit', delete: 'Delete', + owner: 'Owner', admin: 'Admin', plexuser: 'Plex User', deleteuser: 'Delete User', @@ -472,7 +473,7 @@ const UserList: React.FC = () => { {intl.formatMessage(messages.user)} {intl.formatMessage(messages.totalrequests)} - {intl.formatMessage(messages.usertype)} + {intl.formatMessage(messages.accounttype)} {intl.formatMessage(messages.role)} {intl.formatMessage(messages.created)} {intl.formatMessage(messages.lastupdated)} @@ -543,7 +544,9 @@ const UserList: React.FC = () => { )} - {hasPermission(Permission.ADMIN, user.permissions) + {user.id === 1 + ? intl.formatMessage(messages.owner) + : hasPermission(Permission.ADMIN, user.permissions) ? intl.formatMessage(messages.admin) : intl.formatMessage(messages.user)} diff --git a/src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx b/src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx index d426f87cf..3551aff36 100644 --- a/src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx +++ b/src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx @@ -7,7 +7,7 @@ import { useToasts } from 'react-toast-notifications'; import useSWR from 'swr'; import { Language } from '../../../../../server/lib/settings'; import useSettings from '../../../../hooks/useSettings'; -import { UserType, useUser } from '../../../../hooks/useUser'; +import { UserType, useUser, Permission } from '../../../../hooks/useUser'; import Error from '../../../../pages/_error'; import Badge from '../../../Common/Badge'; import Button from '../../../Common/Button'; @@ -19,8 +19,13 @@ const messages = defineMessages({ displayName: 'Display Name', save: 'Save Changes', saving: 'Saving…', + accounttype: 'Account Type', plexuser: 'Plex User', localuser: 'Local User', + role: 'Role', + owner: 'Owner', + admin: 'Admin', + user: 'User', toastSettingsSuccess: 'Settings successfully saved!', toastSettingsFailure: 'Something went wrong while saving settings.', region: 'Discover Region', @@ -37,7 +42,9 @@ const UserGeneralSettings: React.FC = () => { const intl = useIntl(); const { addToast } = useToasts(); const router = useRouter(); - const { user, mutate } = useUser({ id: Number(router.query.userId) }); + const { user, hasPermission, mutate } = useUser({ + id: Number(router.query.userId), + }); const { currentSettings } = useSettings(); const { data, error, revalidate } = useSWR<{ username?: string; @@ -107,7 +114,9 @@ const UserGeneralSettings: React.FC = () => { return (
-
Account Type
+
+ {intl.formatMessage(messages.accounttype)} +
{user?.userType === UserType.PLEX ? ( @@ -122,6 +131,20 @@ const UserGeneralSettings: React.FC = () => {
+
+
+ {intl.formatMessage(messages.role)} +
+
+
+ {user?.id === 1 + ? intl.formatMessage(messages.owner) + : hasPermission(Permission.ADMIN) + ? intl.formatMessage(messages.admin) + : intl.formatMessage(messages.user)} +
+
+