I\'m using Flask Login and Principal for identity and role management. My needs are described straight out of the docs. My code is here:
@identity_loaded.connect