We don't use Flask-Security ourselves (our internal code is mostly Django for user-facing stuff, and we only use Flask for internal microservices which don't do user management). So be warned that anything we suggest won't necessarily be from a position of any deep knowledge :-S
Having said that, I've found this example code which looks like it covers how the whole thing works in a much more in-depth manner than the main documentation. In particular, it appears that you need to create a SQLAlchemyUserDatastore
object and then use its find_or_create_role
and get_user
, create_user
, and add_role_to_user
methods to manage which roles you have and which users are assigned to which roles.
Sorry I can't give more details, but given my lack of knowledge I suspect anything more I tried to infer from the documentation would be as likely to mislead you as help you...