RBAC Changes for Inv Delete IO-559

This commit is contained in:
Patrick Fic
2021-01-21 16:09:15 -08:00
parent 3836750fb3
commit cc82d55508
8 changed files with 44 additions and 4 deletions

View File

@@ -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>
);
}