Hiding fields in Flask-Admin depending on logged in user?
I have Users and Roles in my Flask app thanks to Flask-Security. For some roles I would like to hide certain fields in the forms created by Flask-Admin. I know about customizing ModelViews with eg. form_create_rules = ('title', 'file') but while instantiating a ModelView there isn't access to the current request so current_user.has_role(USER_ROLE) can't be called. Is there any other way to achieve this? pjcunningham One way of achieving this is to create multiple view classes and register these view classes against their appropriate roles. See this answer on how to register roles to views.