Skip to content

Commit

Permalink
Add user to the perm check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kyryliuk committed Feb 13, 2017
1 parent ef4d1de commit d7345ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superset/views.py
Expand Up @@ -87,7 +87,8 @@ def datasource_access_by_name(
return True

schema_perm = utils.get_schema_perm(database, schema)
if schema and utils.can_access(sm, 'schema_access', schema_perm, g.user):
if schema and utils.can_access(
sm, 'schema_access', schema_perm, g.user):
return True

datasources = SourceRegistry.query_datasources_by_name(
Expand Down Expand Up @@ -120,7 +121,8 @@ def accessible_by_user(self, database, datasource_names, schema=None):
return datasource_names

schema_perm = utils.get_schema_perm(database, schema)
if schema and utils.can_access(sm, 'schema_access', schema_perm):
if schema and utils.can_access(
sm, 'schema_access', schema_perm, g.user):
return datasource_names

role_ids = set([role.id for role in g.user.roles])
Expand Down

0 comments on commit d7345ee

Please sign in to comment.