mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 23:05:46 +00:00
feat(FE-331): implement permission guard in purchase
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
} from '@/types/api/purchase/purchase';
|
||||
import { BaseApproval, BaseGroupedApproval } from '@/types/api/api-general';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import RequirePermission from '@/components/helper/RequirePermission';
|
||||
|
||||
interface PurchaseOrderStaffApprovalFormProps {
|
||||
type?: 'add' | 'edit';
|
||||
@@ -897,20 +898,25 @@ const PurchaseOrderStaffApprovalForm = ({
|
||||
<div className='flex justify-center'>
|
||||
{canUpdatePurchaseItems &&
|
||||
canShowDeleteAddButtons && (
|
||||
<Button
|
||||
type='button'
|
||||
color='error'
|
||||
onClick={() =>
|
||||
removePurchaseItem(formItemIndex)
|
||||
}
|
||||
title='Hapus item'
|
||||
>
|
||||
<Icon
|
||||
icon='mdi:trash-can'
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
</Button>
|
||||
<RequirePermission permissions='lti.purchase.delete.item'>
|
||||
<Button
|
||||
type='button'
|
||||
color='error'
|
||||
className='text-sm w-fit'
|
||||
onClick={() =>
|
||||
removePurchaseItem(
|
||||
formItemIndex
|
||||
)
|
||||
}
|
||||
title='Hapus item'
|
||||
>
|
||||
<Icon
|
||||
icon='mdi:trash-can'
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
</Button>
|
||||
</RequirePermission>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user