diff --git a/superset/views/utils.py b/superset/views/utils.py index a3dd432e4f377..7a461f5ae74a0 100644 --- a/superset/views/utils.py +++ b/superset/views/utils.py @@ -62,16 +62,18 @@ def bootstrap_user_data(user: User, include_perms: bool = False) -> Dict[str, Any]: if user.is_anonymous: - return {} - payload = { - "username": user.username, - "firstName": user.first_name, - "lastName": user.last_name, - "userId": user.id, - "isActive": user.is_active, - "createdOn": user.created_on.isoformat(), - "email": user.email, - } + payload = {} + user.roles = (security_manager.find_role("Public"),) + else: + payload = { + "username": user.username, + "firstName": user.first_name, + "lastName": user.last_name, + "userId": user.id, + "isActive": user.is_active, + "createdOn": user.created_on.isoformat(), + "email": user.email, + } if include_perms: roles, permissions = get_permissions(user)