fixed guest role permissions (#21208)

This commit is contained in:
Shubham Sinha 2022-08-28 12:38:41 +05:30 committed by GitHub
parent c61a507e14
commit d408393ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1826,6 +1826,9 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
if user.is_anonymous:
public_role = current_app.config.get("AUTH_ROLE_PUBLIC")
query = query.filter(Role.name == public_role)
elif self.is_guest_user(user):
guest_role = current_app.config.get("GUEST_ROLE_NAME")
query = query.filter(Role.name == guest_role)
else:
query = query.filter(assoc_user_role.c.user_id == user.id)