diff --git a/graylog2-web-interface/src/components/users/UserDetails/UserDetails.test.tsx b/graylog2-web-interface/src/components/users/UserDetails/UserDetails.test.tsx index 9447e360ef..cf179cedf4 100644 --- a/graylog2-web-interface/src/components/users/UserDetails/UserDetails.test.tsx +++ b/graylog2-web-interface/src/components/users/UserDetails/UserDetails.test.tsx @@ -126,7 +126,7 @@ describe('UserDetails', () => { it('should display info if license is not present', async () => { render(); - await screen.findByText(/Enterprise Feature/); + await screen.findAllByText(/Enterprise Feature/); }); }); }); diff --git a/graylog2-web-interface/src/components/users/UserDetails/UserDetails.tsx b/graylog2-web-interface/src/components/users/UserDetails/UserDetails.tsx index 1e1beb8804..0fc06e95e5 100644 --- a/graylog2-web-interface/src/components/users/UserDetails/UserDetails.tsx +++ b/graylog2-web-interface/src/components/users/UserDetails/UserDetails.tsx @@ -69,11 +69,9 @@ const UserDetails = ({ user }: Props) => { )} - {(currentUser.id === user.id || isLocalAdmin) && ( - - - - )} + + + {currentUser.id === user.id && isLocalAdmin && ( diff --git a/graylog2-web-interface/src/components/users/navigation/UserActionLinks.tsx b/graylog2-web-interface/src/components/users/navigation/UserActionLinks.tsx index d5106bdf73..a9dbf03019 100644 --- a/graylog2-web-interface/src/components/users/navigation/UserActionLinks.tsx +++ b/graylog2-web-interface/src/components/users/navigation/UserActionLinks.tsx @@ -16,6 +16,7 @@ */ import * as React from 'react'; +import { IfPermitted } from 'components/common'; import { LinkContainer } from 'components/common/router'; import type User from 'logic/users/User'; import Routes from 'routing/Routes'; @@ -24,21 +25,28 @@ import { ButtonToolbar, Button } from 'components/bootstrap'; type Props = { userId: User['id']; userIsReadOnly: boolean; + username: User['username']; }; -const UserActionLinks = ({ userId, userIsReadOnly }: Props) => ( +const UserActionLinks = ({ userId, userIsReadOnly, username }: Props) => ( - - - - {!userIsReadOnly && ( - - + + + + + {!userIsReadOnly && ( + + + + + )} - - - + + + + + ); diff --git a/graylog2-web-interface/src/pages/UserDetailsPage.tsx b/graylog2-web-interface/src/pages/UserDetailsPage.tsx index 5d0a1c8325..5271c87c44 100644 --- a/graylog2-web-interface/src/pages/UserDetailsPage.tsx +++ b/graylog2-web-interface/src/pages/UserDetailsPage.tsx @@ -56,7 +56,13 @@ const UserDetailsPage = ({ params }: Props) => { } - actions={} + actions={ + + } documentationLink={{ title: 'Permissions documentation', path: DocsHelper.PAGES.USERS_ROLES, diff --git a/graylog2-web-interface/src/pages/UserEditPage.tsx b/graylog2-web-interface/src/pages/UserEditPage.tsx index e76e83084d..d7f6a248d6 100644 --- a/graylog2-web-interface/src/pages/UserEditPage.tsx +++ b/graylog2-web-interface/src/pages/UserEditPage.tsx @@ -67,7 +67,7 @@ const UserEditPage = ({ params }: Props) => { } - actions={} + actions={} documentationLink={{ title: 'Permissions documentation', path: DocsHelper.PAGES.USERS_ROLES, diff --git a/graylog2-web-interface/src/pages/UserTokensEditPage.tsx b/graylog2-web-interface/src/pages/UserTokensEditPage.tsx index 8df8f34433..8282c76040 100644 --- a/graylog2-web-interface/src/pages/UserTokensEditPage.tsx +++ b/graylog2-web-interface/src/pages/UserTokensEditPage.tsx @@ -96,7 +96,13 @@ const UserEditPage = ({ params }: Props) => { } - actions={} + actions={ + + } documentationLink={{ title: 'Permissions documentation', path: DocsHelper.PAGES.USERS_ROLES,