Don't render fed link w/o view-realm access. (#22265)

Fixes #22175
This commit is contained in:
Stan Silvert 2023-08-07 15:37:25 -04:00 committed by GitHub
parent dffa7a31cb
commit 2dec99c443
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,6 +97,7 @@ export const UserForm = ({
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
const { hasAccess } = useAccess(); const { hasAccess } = useAccess();
const isManager = hasAccess("manage-users"); const isManager = hasAccess("manage-users");
const canViewFederationLink = hasAccess("view-realm");
const { const {
handleSubmit, handleSubmit,
@ -209,7 +210,7 @@ export const UserForm = ({
label="requiredUserActions" label="requiredUserActions"
help="users-help:requiredUserActions" help="users-help:requiredUserActions"
/> />
{(user?.federationLink || user?.origin) && ( {(user?.federationLink || user?.origin) && canViewFederationLink && (
<FormGroup <FormGroup
label={t("federationLink")} label={t("federationLink")}
labelIcon={ labelIcon={