feat: add permission-gated navigation and admin access
This commit is contained in:
@@ -6,6 +6,8 @@ import { Plus, Users } from 'lucide-react';
|
||||
import { PageHeader } from '@/components/page-header';
|
||||
import { PoweredBy } from '@/components/powered-by';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { PERMISSIONS } from '@/constants/permissions';
|
||||
import { PermissionGuard } from '@/guards';
|
||||
import type { AdministrationUser } from '@/types';
|
||||
|
||||
import { useUserColumns } from './components/UserColumns';
|
||||
@@ -103,10 +105,12 @@ export default function UsersPage() {
|
||||
description="Manage users and role assignment"
|
||||
icon={Users}
|
||||
actions={
|
||||
<Button onClick={openCreate}>
|
||||
<Plus className="mr-2 size-4" />
|
||||
Add User
|
||||
</Button>
|
||||
<PermissionGuard permissions={PERMISSIONS.USER.CREATE}>
|
||||
<Button onClick={openCreate}>
|
||||
<Plus className="mr-2 size-4" />
|
||||
Add User
|
||||
</Button>
|
||||
</PermissionGuard>
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user