Skip to content

Commit

Permalink
[slice] Adding slice owners to filters
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bodley committed Jun 21, 2018
1 parent 13cbf80 commit c1a35da
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,16 @@ def apply(self, query, func): # noqa
return query
perms = self.get_view_menus('datasource_access')
# TODO(bogdan): add `schema_access` support here
return query.filter(self.model.perm.in_(perms))
return query.filter(
or_(
models.Slice.perm.in_(perms),
models.Slice.id.in_(
db.session.query(models.Slice.id)
.join(models.Slice.owners)
.filter(security_manager.user_model.id == g.user.get_id()),
),
),
)


class DashboardFilter(SupersetFilter):
Expand Down

0 comments on commit c1a35da

Please sign in to comment.