diff --git a/public/app/features/admin/UserOrgs.tsx b/public/app/features/admin/UserOrgs.tsx index b85247e1248..4472ea04f6e 100644 --- a/public/app/features/admin/UserOrgs.tsx +++ b/public/app/features/admin/UserOrgs.tsx @@ -60,7 +60,8 @@ export class UserOrgs extends PureComponent { const addToOrgContainerClass = css` margin-top: 0.8rem; `; - const canAddToOrg = contextSrv.hasPermission(AccessControlAction.OrgUsersAdd); + + const canAddToOrg = contextSrv.hasPermission(AccessControlAction.OrgUsersAdd) && !isExternalUser; return ( <>

Organizations

diff --git a/public/app/features/profile/UserProfileEditForm.tsx b/public/app/features/profile/UserProfileEditForm.tsx index c5748eb515f..c4a95cfdf3d 100644 --- a/public/app/features/profile/UserProfileEditForm.tsx +++ b/public/app/features/profile/UserProfileEditForm.tsx @@ -21,16 +21,22 @@ export const UserProfileEditForm: FC = ({ user, isSavingUser, updateProfi updateProfile(data); }; + // check if authLabels is longer than 0 otherwise false + const isExternalUser: boolean = (user && user.isExternal) ?? false; + const authSource = isExternalUser && user && user.authLabels ? user.authLabels[0] : ''; + const lockMessage = authSource ? ` (Synced via ${authSource})` : ''; + const disabledEdit = disableLoginForm || isExternalUser; + return (
{({ register, errors }) => { return (
Edit profile}> Name is required} - disabled={disableLoginForm} + disabled={disabledEdit} > = ({ user, isSavingUser, updateProfi Email is required} - disabled={disableLoginForm} + disabled={disabledEdit} > = ({ user, isSavingUser, updateProfi } /> @@ -72,7 +78,7 @@ export const UserProfileEditForm: FC = ({ user, isSavingUser, updateProfi