I am working with a MUI data grid that contains different cell types. I am currently seeking a way to implement user permission-based editing for cells in the grid. However, I only want the permission testing to occur when a user attempts to edit a cell, rather than during the initial rendering of the table, in order to optimize the grid's performance.
It is essential for me to utilize the params
for checking permissions, which makes it difficult to perform this task at the column level.
My attempted solution led to displaying the view component inside edit mode, even for users without edit permissions.
renderEditCell: params => hasPermission(params.row.id, userId) ? renderEditMode(params) : renderViewMode(params),
https://i.sstatic.net/Zo5vXtmS.png
How can I achieve my goal of preventing users without edit permissions from entering edit mode?