From da26954c3bfe769a136905d9a37c45b17daa91b1 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 6 Mar 2026 14:21:00 -0800 Subject: [PATCH] IO-3596 Manual Line Lock Down Signed-off-by: Allan Carr --- .../job-detail-lines/job-lines.component.jsx | 82 ++++++++++--------- .../components/rbac-wrapper/rbac-defaults.js | 1 + .../shop-info/shop-info.rbac.component.jsx | 13 +++ client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 6 files changed, 61 insertions(+), 38 deletions(-) diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index d5df5480e..16a3d6c87 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -33,7 +33,7 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react"; import _ from "lodash"; import { FaTasks } from "react-icons/fa"; -import { selectBodyshop } from "../../redux/user/user.selectors"; +import { selectAuthLevel, selectBodyshop } from "../../redux/user/user.selectors"; import dayjs from "../../utils/day"; import InstanceRenderManager from "../../utils/instanceRenderMgr"; import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; @@ -49,6 +49,7 @@ import JobLinesPartPriceChange from "./job-lines-part-price-change.component"; import JobLinesExpanderSimple from "./jobs-lines-expander-simple.component"; import { logImEXEvent } from "../../firebase/firebase.utils"; import { useNotification } from "../../contexts/Notifications/notificationContext.jsx"; +import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component.jsx"; const UPDATE_JOB_LINES_LOCATION_BULK = gql` mutation UPDATE_JOB_LINES_LOCATION_BULK($ids: [uuid!]!, $location: String!) { @@ -66,7 +67,8 @@ const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, jobRO: selectJobReadOnly, technician: selectTechnician, - isPartsEntry: selectIsPartsEntry + isPartsEntry: selectIsPartsEntry, + authLevel: selectAuthLevel }); const mapDispatchToProps = (dispatch) => ({ @@ -94,7 +96,8 @@ export function JobLinesComponent({ setTaskUpsertContext, billsQuery, handlePartsOrderOnRowClick, - isPartsEntry + isPartsEntry, + authLevel }) { const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK); const [bulkUpdateLocations] = useMutation(UPDATE_JOB_LINES_LOCATION_BULK); @@ -386,18 +389,20 @@ export function JobLinesComponent({ key: "actions", render: (text, record) => ( - {(record.manual_line || jobIsPrivate) && !technician && ( - - {!isPartsEntry && ( + {!isPartsEntry && HasRbacAccess({ bodyshop, authLevel, action: "jobs:manual-line" }) && (