mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
fix: no roles being returned for anonymous user (#15585)
This commit is contained in:
parent
663dd3f853
commit
e5540b79ec
@ -62,16 +62,18 @@ if not app.config["ENABLE_JAVASCRIPT_CONTROLS"]:
|
|||||||
|
|
||||||
def bootstrap_user_data(user: User, include_perms: bool = False) -> Dict[str, Any]:
|
def bootstrap_user_data(user: User, include_perms: bool = False) -> Dict[str, Any]:
|
||||||
if user.is_anonymous:
|
if user.is_anonymous:
|
||||||
return {}
|
payload = {}
|
||||||
payload = {
|
user.roles = (security_manager.find_role("Public"),)
|
||||||
"username": user.username,
|
else:
|
||||||
"firstName": user.first_name,
|
payload = {
|
||||||
"lastName": user.last_name,
|
"username": user.username,
|
||||||
"userId": user.id,
|
"firstName": user.first_name,
|
||||||
"isActive": user.is_active,
|
"lastName": user.last_name,
|
||||||
"createdOn": user.created_on.isoformat(),
|
"userId": user.id,
|
||||||
"email": user.email,
|
"isActive": user.is_active,
|
||||||
}
|
"createdOn": user.created_on.isoformat(),
|
||||||
|
"email": user.email,
|
||||||
|
}
|
||||||
|
|
||||||
if include_perms:
|
if include_perms:
|
||||||
roles, permissions = get_permissions(user)
|
roles, permissions = get_permissions(user)
|
||||||
|
Loading…
Reference in New Issue
Block a user