diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index 9669032f14c..ef02ecf4644 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -587,6 +587,7 @@ export function UserFacilities(props: { user: any }) { facility?: FacilityModel; isHomeFacility: boolean; }>({ show: false, userName: "", facility: undefined, isHomeFacility: false }); + const authUser = useAuthUser(); const [replaceHomeFacility, setReplaceHomeFacility] = useState<{ show: boolean; @@ -762,39 +763,39 @@ export function UserFacilities(props: { user: any }) { {user?.home_facility_object && (
-
-
- {user?.home_facility_object?.name}{" "} - - - Home Facility - -
-
- -
+
+ {user?.home_facility_object?.name} + + + Home Facility + + {(["DistrictAdmin", "StateAdmin"].includes( + authUser.user_type, + ) || + username === authUser.username) && ( +
+ +
+ )}
@@ -820,49 +821,56 @@ export function UserFacilities(props: { user: any }) { >
{facility.name} -
- + )} + - -
+ }} + > + + + Unlink Facility + + +
+ )}
);