Flask Admin - how to set form_edit_rules or form_create_rules based on role of user?
问题 I am making simple ticketing system for medium-sized organization using Flask and sqlite together with SQLAlchemy. For backend managing of data I use Flask-Admin. The User and Ticket table looks like this: class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) role = db.Column(db.Integer, default=0) vmc_kom = db.Column(db.String(20)) name = db.Column(db.String(30), nullable=False) phone = db.Column(db.String, default="not") email = db.Column(db.String(40), nullable