mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 20: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:
@@ -112,7 +112,7 @@ const ComponentPage: FC<Props> = ({ data, actions }) => {
|
||||
{
|
||||
title: 'Action',
|
||||
key: 'action',
|
||||
render: (_, record) => actions.includes('UPDATE') || actions.includes('DELETE') && (
|
||||
render: (_, record) => (actions.includes('UPDATE') || actions.includes('DELETE')) && (
|
||||
<AlertDialog>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
@@ -163,7 +163,7 @@ const ComponentPage: FC<Props> = ({ data, actions }) => {
|
||||
<div className="flex flex-1 items-center space-x-2">
|
||||
<Input placeholder="Search department..." className="h-8 w-full sm:w-62.5 lg:w-72" onChange={handleSearch} />
|
||||
</div>
|
||||
{actions.includes('CREATE') ?
|
||||
{actions?.includes('CREATE') ?
|
||||
<Button variant='ghost' size="sm" className="ml-auto h-8 w-full sm:w-max text-his" onClick={() => setShowFormDialog(true)}>
|
||||
<PlusCircledIcon className="mr-2 h-4 w-4" />
|
||||
Create New Department
|
||||
|
||||
Reference in New Issue
Block a user