mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 23:26:28 +00:00
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:
@@ -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'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'>
|
||||
|
||||
Reference in New Issue
Block a user