Apply RBAC permissions across admin and tasks

Enforce page access and action-level permissions across admin and task views, including exports and record actions. Move user creation to a client component behind server-side permission checks, standardize data fetching, and remove the deprecated user-role route.
This commit is contained in:
Ichsan Kurniawan
2026-11-09 17:32:31 +07:00
parent 1b37ff65f5
commit 279b642a7a
69 changed files with 1070 additions and 1167 deletions
@@ -12,9 +12,10 @@ const ExportComponent = lazy(() => import('./Export'));
type Props = {
data: IHistory[]
actions?: string[]
};
const ComponentPage: FC<Props> = ({ data }) => {
const ComponentPage: FC<Props> = ({ data, actions }) => {
const [groupData, setGroupData] = useState<any>(null)
useEffect(() => {
@@ -664,9 +665,11 @@ const ComponentPage: FC<Props> = ({ data }) => {
<CardTitle>Attendance Distribution</CardTitle>
<CardDescription className='mt-1 sm:block hidden'>Here&apos;s a list of all employee attendance distribution!</CardDescription>
</div>
<Suspense fallback={<LazyLoading />}>
<ExportComponent data={groupData} />
</Suspense>
{actions?.includes('EXPORT') &&
<Suspense fallback={<LazyLoading />}>
<ExportComponent data={groupData} />
</Suspense>
}
</CardHeader>
<CardContent>
<div className='flex flex-col space-y-4'>