mistercrunch commented on code in PR #32770: URL: https://github.com/apache/superset/pull/32770#discussion_r2005900039
########## superset/utils/core.py: ########## @@ -1292,6 +1292,19 @@ def get_user_email() -> str | None: return None +def get_user_roles() -> list[str] | None: + """ + Get the roles (if defined) associated with the current user. + + :returns: The roles + """ + + try: + return [role.name for role in g.user.roles] Review Comment: not sure why we need super generic error handling here. If anything I'd try to mimic whatever error handling is done (or not done) in `superset/jinja_context.py` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org