Implementing row-level security
Implementing row-level security
Do you have a suggestion on how one might implement row-level security in DataTables and Editor?
For example, assume a table of Notes. In the Ajax load I can provide a hidden attribute per row that indicates if the user can edit or delete that row.
If the user cannot edit or delete that row, I'd like to be able to NOT enable the Edit and Delete buttons in Editor if they highlight that row.
Oh, I'm also running with "so" (and not "os") so there is no ability to select multiple rows.
Any ideas are appreciated, and I'd be happy to post a working solution.
This question has an accepted answers - jump to answer
Answers
I feel it is a little hacky, but you could use
preOpen
to check and see what the row's data is and returnfalse
to cancel the form's display if it doesn't match the editing requirements.I think ultimately the best fix would probably be simply not to call the
edit()
method on click of the buttons. That would involve providing your ownfnClick
function for the buttons that will call the Editor API.Regards,
Allan