From e67f6719834c851baa1ab9cdd647dc22ee5e7497 Mon Sep 17 00:00:00 2001 From: Ichsan Kurniawan <43689091+ichsankurnia@users.noreply.github.com> Date: Tue, 10 Nov 2026 11:27:05 +0700 Subject: [PATCH] Enforce assignment permissions and show active milestones Gate assignment creation and editing by the relevant permissions, show ongoing milestones on the timeline, and restrict the forbidden-page admin link to authorized users. Also use the shared RBAC role type and tighten sidebar active-state matching. --- app/(dashboard)/profile/components/type.ts | 2 +- .../(main)/ClientDetailComponent.tsx | 10 +- .../[client_id]/(main)/ClientProfileCard.tsx | 2 +- .../client-detail/[client_id]/(main)/page.tsx | 1 + .../[client_id]/project-assignments/page.tsx | 3 + .../client/ClientMilestoneTimeline.tsx | 156 +++++++++++++----- .../user/create/UserCreateClient.tsx | 2 +- app/admin/components/SidebarItem.tsx | 6 +- app/forbidden/page.tsx | 21 ++- 9 files changed, 147 insertions(+), 56 deletions(-) diff --git a/app/(dashboard)/profile/components/type.ts b/app/(dashboard)/profile/components/type.ts index bdb4563..34f1bab 100644 --- a/app/(dashboard)/profile/components/type.ts +++ b/app/(dashboard)/profile/components/type.ts @@ -4,7 +4,7 @@ import { IDivision } from "@/app/admin/administration/division/component/type" import { IEmployeeType } from "@/app/admin/information/employee-type/component/type" import { IMasterStatus } from "@/app/admin/information/master-status/component/type" import { IPosition } from "@/app/admin/information/position/component/type" -import { IRole } from "@/app/admin/information/user-role/component/type" +import { IRole } from "@/types/rbac" export type IProfile = { id: number diff --git a/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx b/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx index 8a8e6ed..51530a2 100644 --- a/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx +++ b/app/(dashboard)/task/client-detail/[client_id]/(main)/ClientDetailComponent.tsx @@ -133,13 +133,16 @@ export default function ClientDetailComponent({ clientId, assignmentLists, actio This client doesn't have any projects or internal memos yet. Try to change the filter or create one to get started.
- - - + {actions?.includes("CREATE_ASSIGNMENT") && + + + + } ) : activeLayout === 'grid' ? (