forked from baron/baron-sso
adminfront: 권한 부여(permissions-direct) 메뉴 및 페이지 접근 권한을 Super Admin 전용으로 일제 제한 완료
This commit is contained in:
@@ -267,7 +267,7 @@ function AppLayout() {
|
||||
if (item.to === "/auth") return permissions.auth_guard;
|
||||
if (item.to === "/api-keys") return permissions.api_keys;
|
||||
if (item.to === "/audit-logs") return permissions.audit_logs;
|
||||
if (item.to === "/permissions-direct") return permissions.permissions_direct || _manageableCount > 0;
|
||||
if (item.to === "/permissions-direct") return false;
|
||||
if (item.to === "/tenants") return permissions.tenants;
|
||||
if (item.to === orgfrontUrl) return permissions.org_chart;
|
||||
if (item.to === "/worksmobile") return permissions.worksmobile && showWorksmobile;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import type { AxiosError } from "axios";
|
||||
import { useState, useEffect } from "react";
|
||||
import {
|
||||
@@ -55,6 +56,7 @@ import { toast } from "../../../components/ui/use-toast";
|
||||
|
||||
export function TenantFineGrainedPermissionsPage() {
|
||||
const queryClient = useQueryClient();
|
||||
const navigate = useNavigate();
|
||||
const [activeTab, setActiveTab] = useState<"tenant" | "system">("system");
|
||||
const [selectedTenantId, setSelectedTenantId] = useState("");
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@@ -72,6 +74,19 @@ export function TenantFineGrainedPermissionsPage() {
|
||||
|
||||
const isSuperAdmin = profile?.role === "super_admin";
|
||||
|
||||
if (profile && !isSuperAdmin) {
|
||||
return (
|
||||
<div className="flex h-[50vh] flex-col items-center justify-center space-y-4">
|
||||
<h3 className="text-lg font-bold">
|
||||
{t("msg.admin.common.forbidden", "접근 권한이 없습니다.")}
|
||||
</h3>
|
||||
<Button onClick={() => navigate("/")}>
|
||||
{t("ui.common.go_home", "홈으로 이동")}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const tenantsQuery = useQuery({
|
||||
queryKey: ["tenants", "list-all"],
|
||||
queryFn: () => fetchAllTenants(),
|
||||
|
||||
Reference in New Issue
Block a user