Allow users with 'view-users' permission to see the 'credentials' tab (#19587)
Closes #17174
This commit is contained in:
parent
2c663c2fcc
commit
396e2ba931
2 changed files with 2 additions and 2 deletions
|
@ -233,7 +233,7 @@ const EditUserForm = ({ user, bruteForced, refresh }: EditUserFormProps) => {
|
|||
</Tab>
|
||||
<Tab
|
||||
data-testid="credentials"
|
||||
isHidden={!user.access?.manage}
|
||||
isHidden={!user.access?.view}
|
||||
title={<TabTitleText>{t("common:credentials")}</TabTitleText>}
|
||||
{...credentialsTab}
|
||||
>
|
||||
|
|
|
@ -651,7 +651,7 @@ public class UserResource {
|
|||
@NoCache
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Stream<CredentialRepresentation> credentials(){
|
||||
auth.users().requireManage(user);
|
||||
auth.users().requireView(user);
|
||||
return user.credentialManager().getStoredCredentialsStream()
|
||||
.map(ModelToRepresentation::toRepresentation)
|
||||
.peek(credentialRepresentation -> credentialRepresentation.setSecretData(null));
|
||||
|
|
Loading…
Reference in a new issue