diff --git a/adminfront/src/features/users/UserCreatePage.tsx b/adminfront/src/features/users/UserCreatePage.tsx index e17785bd..e0d70f18 100644 --- a/adminfront/src/features/users/UserCreatePage.tsx +++ b/adminfront/src/features/users/UserCreatePage.tsx @@ -158,7 +158,7 @@ function UserCreatePage() { queryFn: fetchMe, }); const profileRole = normalizeAdminRole(profile?.role); - const canManageUsers = canManageTenantScopedUsers(profile); + const canManageUsers = canManageTenantScopedUsers(profile) || !!profile?.systemPermissions?.manage_users; const { register, diff --git a/adminfront/src/features/users/UserDetailPage.tsx b/adminfront/src/features/users/UserDetailPage.tsx index 8248d35b..ebf50926 100644 --- a/adminfront/src/features/users/UserDetailPage.tsx +++ b/adminfront/src/features/users/UserDetailPage.tsx @@ -578,6 +578,8 @@ function UserDetailPage() { const isAdmin = profileRole === "super_admin"; const isSelf = Boolean(profile?.id && user?.id && profile.id === user.id); const canManageCurrentUser = canManageUserInTenantScope({ profile, user }); + const isWritable = isAdmin || isSelf || canManageCurrentUser || !!profile?.systemPermissions?.manage_users; + const canViewUser = isAdmin || isSelf || canManageCurrentUser || !!profile?.systemPermissions?.users || !!profile?.systemPermissions?.manage_users; const watchedStatus = watch("status"); const [newSubEmail, setNewSubEmail] = React.useState(""); @@ -1138,7 +1140,7 @@ function UserDetailPage() { ); } - if (!isAdmin && !isSelf && !canManageCurrentUser) { + if (profile && !canViewUser) { return (