-2

I'm learning to make a project using Flask and Flask-User and MongoEngine. What I want to do is an account holder (a company) signs up to use the app and then that account holder can create sub-user access with limited privileges for their staff. When I followed the Flask-User documentation on Role and UserRoles data-models, it seems like I cannot create that kind of super-user sub-user structure because user_id refers back to the user that registers. So how do I go about doing this?

Thanks!

ktcao
  • 1

1 Answers1

0

I don't think Flask-User is designed for the organizational features you are asking for. However, there are packages that provide some more guidance on creating groups of users and authorization structures around that. For example: Flask-Authorize

If that adds too much complexity, you could always consider implementing something of your own. For example adding a manager_id on the user model and implicitly making users with a valid manager_id set a type of sub-user you are talking about.

Eelke van den Bos
  • 1,423
  • 1
  • 13
  • 18