forked from baron/baron-sso
Merge origin/dev into dev
This commit is contained in:
@@ -382,6 +382,8 @@ function UserListPage() {
|
||||
queryFn: fetchMe,
|
||||
});
|
||||
const profileRole = normalizeAdminRole(profile?.role);
|
||||
const isWritable =
|
||||
profileRole === "super_admin" || !!profile?.systemPermissions?.manage_users;
|
||||
|
||||
const { data: tenantsData } = useQuery({
|
||||
queryKey: ["tenants", "all"],
|
||||
@@ -796,8 +798,9 @@ function UserListPage() {
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
onSelect={() => {
|
||||
setBulkUploadOpen(true);
|
||||
if (isWritable) setBulkUploadOpen(true);
|
||||
}}
|
||||
disabled={!isWritable}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
<Upload size={16} className="mr-2 opacity-50" />
|
||||
@@ -889,12 +892,19 @@ function UserListPage() {
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
<Button asChild size="sm" className="h-9">
|
||||
<Link to="/users/new">
|
||||
{isWritable ? (
|
||||
<Button asChild size="sm" className="h-9">
|
||||
<Link to="/users/new">
|
||||
<Plus size={16} />
|
||||
{t("ui.admin.users.list.add", "사용자 추가")}
|
||||
</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button size="sm" className="h-9" disabled>
|
||||
<Plus size={16} />
|
||||
{t("ui.admin.users.list.add", "사용자 추가")}
|
||||
</Link>
|
||||
</Button>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -1172,7 +1182,8 @@ function UserListPage() {
|
||||
}
|
||||
disabled={
|
||||
statusMutation.isPending ||
|
||||
user.id === profile?.id
|
||||
user.id === profile?.id ||
|
||||
!isWritable
|
||||
}
|
||||
>
|
||||
<SelectTrigger
|
||||
@@ -1341,7 +1352,8 @@ function UserListPage() {
|
||||
}}
|
||||
disabled={
|
||||
(!selectedBulkStatus && !selectedBulkPermission) ||
|
||||
bulkUpdateMutation.isPending
|
||||
bulkUpdateMutation.isPending ||
|
||||
!isWritable
|
||||
}
|
||||
data-testid="bulk-apply-btn"
|
||||
>
|
||||
@@ -1354,6 +1366,7 @@ function UserListPage() {
|
||||
size="sm"
|
||||
className="text-destructive-foreground hover:bg-destructive/20 h-8 gap-1.5"
|
||||
onClick={handleBulkDelete}
|
||||
disabled={!isWritable}
|
||||
data-testid="bulk-delete-btn"
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
|
||||
Reference in New Issue
Block a user