diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index 997d456..2cdf50a 100644 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -18,11 +18,12 @@ import { View } from './View' import '@styles/index.css' import '@styles/measure.css' +import { hasPermission } from '@asb/utils/permissions' const createEditingColumns = (cols, renderDelegate) => cols.map(col => ({ render: renderDelegate, ...col })) -export const MeasureTable = memo(({idWell, group, updateMeasuresFunc, additionalButtons}) => { +export const MeasureTable = memo(({ idWell, group, updateMeasuresFunc, additionalButtons }) => { const [showLoader, setShowLoader] = useState(false) const [displayedValues, setDisplayedValues] = useState({}) const [editingColumns, setEditingColumns] = useState(group.columns) @@ -64,7 +65,9 @@ export const MeasureTable = memo(({idWell, group, updateMeasuresFunc, additional 'Удаление записи для скважины' ) - const isDataDefault = () => !!displayedValues?.isDefaultData + const disabled = !hasPermission('Measure.edit') + const editingDisabled = disabled || !!displayedValues?.isDefaultData + const deleteDisabled = !hasPermission('Measure.delete') || !!displayedValues?.isDefaultData const editTable = (action) => { setEditingActionName(action) @@ -116,14 +119,14 @@ export const MeasureTable = memo(({idWell, group, updateMeasuresFunc, additional ) : ( <> - - - - diff --git a/src/pages/WellOperations/ImportExportBar.jsx b/src/pages/WellOperations/ImportExportBar.jsx index 6dd3481..9e5f846 100644 --- a/src/pages/WellOperations/ImportExportBar.jsx +++ b/src/pages/WellOperations/ImportExportBar.jsx @@ -3,6 +3,7 @@ import { Button, Tooltip, Modal } from 'antd' import { FileOutlined, ImportOutlined, ExportOutlined } from '@ant-design/icons' import { download } from '@components/factory' +import { hasPermission } from '@utils/permissions' import { ImportOperations } from './ImportOperations' @@ -23,7 +24,7 @@ export const ImportExportBar = memo(({ idWell, onImported, disabled }) => { <>