I am creating a Flask-Admin app that requires checking permissions to View, Edit & Delete certain rows in a table.
i.e, I would like to:
- List only rows where the User ID matches the Owner ID of the row
- Let the user Create a row if they have a certain Role
- Only let user Edit a row if they have a certain Role
I can think of overriding methods query(), on_model_change(), etc to check an Edit permit, but:
- A user could still view the row by changing the URL to display the Edit screen
- I don't know how to restrict a WTForms one-to-many edit list to only allowed items
How may I achieve this?