1
0
forked from baron/baron-sso

feat(adminfront): implement user role management and cleanup tenant list UI

- Add user role management (view, edit, bulk) in UserListPage, UserDetailPage, and UserCreatePage.
- Restrict role modification to super_admin only.
- Remove redundant action columns from tenant-related lists (TenantListPage, TenantSubTenantsPage, TenantUsersPage, TenantAdminsAndOwnersTab).
- Improve navigation by making table rows clickable where actions were removed.
This commit is contained in:
2026-05-13 14:50:11 +09:00
parent 5f48a1c172
commit a31eceaf16
7 changed files with 170 additions and 174 deletions

View File

@@ -743,10 +743,8 @@ function UserDetailPage() {
userType,
};
const profileData = { ...data };
profileData.role = undefined;
const payload: UserUpdateRequest = {
...profileData,
...data,
metadata,
};
@@ -1068,6 +1066,35 @@ function UserDetailPage() {
</span>
</div>
</div>
<div className="space-y-2">
<Label
htmlFor="role"
className="text-xs font-bold uppercase text-muted-foreground"
>
{t("ui.admin.users.detail.form.role", "역할")}
</Label>
<div className="flex h-11 items-center gap-3">
<select
id="role"
className="flex h-11 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:opacity-50"
{...register("role")}
disabled={profile?.role !== "super_admin" || profile?.id === user.id}
>
<option value="super_admin">
{t("ui.admin.role.super_admin", "시스템 관리자")}
</option>
<option value="tenant_admin">
{t("ui.admin.role.tenant_admin", "테넌트 관리자")}
</option>
<option value="rp_admin">
{t("ui.admin.role.rp_admin", "서비스 관리자")}
</option>
<option value="user">
{t("ui.admin.role.user", "일반 사용자")}
</option>
</select>
</div>
</div>
</div>
<Tabs