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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user