Skip to content

Commit

Permalink
Remove redundant mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Charl1996 committed Nov 1, 2024
1 parent 116c060 commit 6cae9cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions hq_superset/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
HQ_USER_ROLE_NAME = "hq_user"
GAMMA_ROLE = "Gamma"

HQ_ROLE_NAME_MAPPING = {
GAMMA_ROLE: "Gamma",
"dataset_editor": "dataset_editor",
"sql_lab": "sql_lab",
}

# Permissions
SCHEMA_ACCESS_PERMISSION = "schema_access"
Expand Down
4 changes: 1 addition & 3 deletions hq_superset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from .const import (
GAMMA_ROLE,
HQ_DATABASE_NAME,
HQ_ROLE_NAME_MAPPING,
HQ_USER_ROLE_NAME,
SCHEMA_ACCESS_PERMISSION,
CAN_READ_PERMISSION,
Expand Down Expand Up @@ -253,8 +252,7 @@ def _user_has_no_access(permissions: dict):
def _get_platform_roles(self, roles_names):
platform_roles = []
for role_name in roles_names:
superset_role_name = HQ_ROLE_NAME_MAPPING.get(role_name, role_name)
role = self.sm.find_role(superset_role_name)
role = self.sm.find_role(role_name)
if role:
platform_roles.append(role)
return platform_roles
Expand Down

0 comments on commit 6cae9cb

Please sign in to comment.