Search code examples
pythonflaskacl

Implementing ACL with flask


I just built a little web application with flask and I want to manage users roles and accessibility to the endpoint according to their role etc and for that, I want to use something like acl (Access Control List) but I can't find anything useful or clear enough to understand.
I found flask-acl but the documentation is so poor, I found flask-simpleacl but I can't put my hands on any useful documentation.
I can't even find tutorials or examples about so can someone suggest a good useful flask extension or library for that or just point me to some documentation, examples or tutorials?
Thanks.


Solution

  • I ended up trying to use flask_principal as someone suggested to me here (but for some reason, they deleted their answer), it's great and helpful especially if you combine it with flask_login. So I hope this helps someone.
    The only issue is if you want for example show/hide some content on your HTML pages based on the user's role, then you have to set it manually with session variables which is mostly going back to the start point (unless I'm missing something).
    Good luck.