Merge pull request '260716_03_ENH: 권한 별 노출에 대한 수정' (#5) from develop into master

Reviewed-on: #5
This commit is contained in:
2026-07-16 15:59:51 +09:00
3 changed files with 32 additions and 14 deletions

View File

@@ -27,7 +27,7 @@ import {
useSaveAssignedFieldworkMutation, useSaveAssignedFieldworkMutation,
useProjectTopQuery, useProjectTopQuery,
} from "@/query/project"; } from "@/query/project";
import { isFieldWorkUser } from "@/utils/userRole"; import { isExternalManager, isFieldWorkUser } from "@/utils/userRole";
const ProjectAssignPage = () => { const ProjectAssignPage = () => {
const mounted = useMounted(); const mounted = useMounted();
@@ -36,6 +36,8 @@ const ProjectAssignPage = () => {
const prjctIdx = selectedProject?.prjctIdx ?? 0; const prjctIdx = selectedProject?.prjctIdx ?? 0;
const enabled = mounted && prjctIdx > 0; const enabled = mounted && prjctIdx > 0;
// 외주사 계정은 자기 회사 배정만 봐야 하므로 회사 select 자체를 조작하지 못하게 막는다.
const isExternalUser = isExternalManager(auth.user?.userRole);
const companyQuery = useCmpnListQuery(); const companyQuery = useCmpnListQuery();
const fwUsersQuery = useFieldworkUsersQuery(enabled); const fwUsersQuery = useFieldworkUsersQuery(enabled);
@@ -282,6 +284,7 @@ const ProjectAssignPage = () => {
placeholder="회사 선택" placeholder="회사 선택"
className="w-56 h-9" className="w-56 h-9"
useAll={false} useAll={false}
disabled={isExternalUser}
/> />
</div> </div>

View File

@@ -50,7 +50,7 @@ import MessageSendDialog, { type MessageSendMode } from '@/components/dialog/Mes
import MessageHistoryDialog from '@/components/dialog/MessageHistoryDialog' import MessageHistoryDialog from '@/components/dialog/MessageHistoryDialog'
import { downloadBase64File, downloadFile, XLSX_MIME_TYPE } from '@kri/common/browser' import { downloadBase64File, downloadFile, XLSX_MIME_TYPE } from '@kri/common/browser'
import {CONTACT_INTERVIEWER_ROLE} from "@/const/userConst"; import {CONTACT_INTERVIEWER_ROLE} from "@/const/userConst";
import { isManager } from "@/utils/userRole"; import { isInternalManager, isManager } from "@/utils/userRole";
import { applyListAccessFilter } from "@/utils/listAccess"; import { applyListAccessFilter } from "@/utils/listAccess";
const toDateTimeRange = (from?: string, to?: string) => { const toDateTimeRange = (from?: string, to?: string) => {
@@ -103,6 +103,8 @@ const ListManagePage = () => {
const prjctIdx = selectedProject?.prjctIdx ?? 0 const prjctIdx = selectedProject?.prjctIdx ?? 0
const enabled = mounted && prjctIdx > 0 const enabled = mounted && prjctIdx > 0
const canManageList = isManager(userRole); const canManageList = isManager(userRole);
// 리스트 초기화/헤더 관리/업로드는 내부 관리자 전용 — 외주사 계정에는 노출되면 안 됨.
const isInternal = isInternalManager(userRole);
const resultCodesQuery = useResultCodesQuery(prjctIdx, enabled) const resultCodesQuery = useResultCodesQuery(prjctIdx, enabled)
const listHeaderQuery = useListHeaderQuery(prjctIdx, enabled) const listHeaderQuery = useListHeaderQuery(prjctIdx, enabled)
@@ -261,6 +263,7 @@ const ListManagePage = () => {
<div className="space-y-6 text-sm"> <div className="space-y-6 text-sm">
{canManageList && ( {canManageList && (
<ListManageActions <ListManageActions
showAdminActions={isInternal}
onReset={() => showDialog('listResetDialog')} onReset={() => showDialog('listResetDialog')}
onHeaderManage={() => showDialog('listHeaderManageDialog')} onHeaderManage={() => showDialog('listHeaderManageDialog')}
onUpload={() => showDialog('listUploadDialog')} onUpload={() => showDialog('listUploadDialog')}
@@ -296,7 +299,7 @@ const ListManagePage = () => {
focusRowId={restoredForThisProject?.sid} focusRowId={restoredForThisProject?.sid}
/> />
{canManageList && ( {isInternal && (
<> <>
<ListResetDialog filterSummary={filterSummary} onConfirm={handleResetConfirm} /> <ListResetDialog filterSummary={filterSummary} onConfirm={handleResetConfirm} />
<ListUploadDialog <ListUploadDialog
@@ -310,6 +313,11 @@ const ListManagePage = () => {
headerRows={headerManageRows} headerRows={headerManageRows}
/> />
<ListHeaderManageDialog prjctIdx={prjctIdx} rows={headerManageRows} onConfirm={handleHeaderManageConfirm} /> <ListHeaderManageDialog prjctIdx={prjctIdx} rows={headerManageRows} onConfirm={handleHeaderManageConfirm} />
</>
)}
{canManageList && (
<>
<ListDownloadDialog mode={downloadMode} filterSummary={filterSummary} onDownload={handleDownloadConfirm} /> <ListDownloadDialog mode={downloadMode} filterSummary={filterSummary} onDownload={handleDownloadConfirm} />
<MessageSendDialog <MessageSendDialog
mode={messageSendMode} mode={messageSendMode}

View File

@@ -13,6 +13,8 @@ import type { ListDownloadMode } from '@/types/list'
import type { MessageSendMode } from '@/components/dialog/MessageSendDialog' import type { MessageSendMode } from '@/components/dialog/MessageSendDialog'
export type ListManageActionsProps = { export type ListManageActionsProps = {
/** 리스트 초기화/헤더 관리/업로드처럼 내부 관리자 전용 버튼 노출 여부 (외주사 계정에는 숨겨야 함) */
showAdminActions: boolean
onReset: () => void onReset: () => void
onHeaderManage: () => void onHeaderManage: () => void
onUpload: () => void onUpload: () => void
@@ -22,6 +24,7 @@ export type ListManageActionsProps = {
} }
export function ListManageActions({ export function ListManageActions({
showAdminActions,
onReset, onReset,
onHeaderManage, onHeaderManage,
onUpload, onUpload,
@@ -32,6 +35,8 @@ export function ListManageActions({
return ( return (
<div className="flex gap-2 items-center"> <div className="flex gap-2 items-center">
<div className="flex flex-1 items-center gap-2 flex-wrap"> <div className="flex flex-1 items-center gap-2 flex-wrap">
{showAdminActions && (
<>
<Button variant="destructive" className="text-base gap-2" onClick={onReset}> <Button variant="destructive" className="text-base gap-2" onClick={onReset}>
<RotateCcw className="w-4 h-4" /> <RotateCcw className="w-4 h-4" />
리스트 초기화 리스트 초기화
@@ -43,6 +48,8 @@ export function ListManageActions({
<Upload className="w-4 h-4" /> <Upload className="w-4 h-4" />
리스트 업로드 리스트 업로드
</Button> </Button>
</>
)}
<Button className="text-base bg-excel gap-2" onClick={() => onDownload('list')}> <Button className="text-base bg-excel gap-2" onClick={() => onDownload('list')}>
<Download className="w-4 h-4" /> <Download className="w-4 h-4" />
리스트 리스트