mistercrunch commented on code in PR #32770: URL: https://github.com/apache/superset/pull/32770#discussion_r2010812193
########## 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: how about `return sorted([role.name for role in g.user.roles])` so it's a bit more deterministic? -- 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