feat: role system fix
This commit is contained in:
@@ -781,7 +781,7 @@ export const DevicesTable = observer(() => {
|
||||
Добавить устройство
|
||||
</Button>
|
||||
)}
|
||||
{selectedIds.length > 0 && (
|
||||
{canWriteDevices && selectedIds.length > 0 && (
|
||||
<Button
|
||||
variant="contained"
|
||||
color="error"
|
||||
@@ -862,16 +862,18 @@ export const DevicesTable = observer(() => {
|
||||
<DataGrid
|
||||
rows={groupRows}
|
||||
columns={columns}
|
||||
checkboxSelection
|
||||
checkboxSelection={canWriteDevices}
|
||||
disableRowSelectionExcludeModel
|
||||
loading={isLoading}
|
||||
paginationModel={paginationModel}
|
||||
onPaginationModelChange={setPaginationModel}
|
||||
pageSizeOptions={[50]}
|
||||
onRowSelectionModelChange={
|
||||
createSelectionHandler(groupRowIds) as (
|
||||
ids: unknown,
|
||||
) => void
|
||||
canWriteDevices
|
||||
? (createSelectionHandler(groupRowIds) as (
|
||||
ids: unknown,
|
||||
) => void)
|
||||
: undefined
|
||||
}
|
||||
rowSelectionModel={{
|
||||
type: "include",
|
||||
|
||||
Reference in New Issue
Block a user