RBAC Changes for Inv Delete IO-559
This commit is contained in:
@@ -3,6 +3,7 @@ import { Button, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||
|
||||
export default function BillDeleteButton({ bill }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -45,8 +46,10 @@ export default function BillDeleteButton({ bill }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Button disabled={bill.exported} onClick={handleDelete} loading={loading}>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
<RbacWrapper action="bills:delete" noauth={<></>}>
|
||||
<Button disabled={bill.exported} onClick={handleDelete} loading={loading}>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
</RbacWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ const ret = {
|
||||
"bills:enter": 2,
|
||||
"bills:view": 2,
|
||||
"bills:list": 2,
|
||||
"bills:delete": 3,
|
||||
|
||||
"employees:page": 5,
|
||||
|
||||
|
||||
@@ -272,6 +272,18 @@ export default function ShopInfoRbacComponent({ form }) {
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.bills.delete")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={["md_rbac", "bills:delete"]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.bills.view")}
|
||||
rules={[
|
||||
|
||||
Reference in New Issue
Block a user