superset icon indicating copy to clipboard operation
superset copied to clipboard

New Feature: Dynamic Filtering Based on User

Open csc5k opened this issue 8 years ago • 5 comments

It would be great if we could configure Superset to apply dynamic filters to a dashboard based on the user/role. I'm thinking about having a way for a single dashboard record that is automatically filtered based on who's viewing it - if a user should only see data for one province, department, country, etc. (basically a dimension), an admin could assign that dimension as an auto-filter in their user / user role.

This prevents an admin from having to build one pre-filtered version of the dashboard per view (which could be very numerous), and doesn't open up the risk of a user viewing data from an unauthorized area.

Currently, the only restrictions like this are around individual metrics (too granular) and data sources (too broad).

csc5k avatar Apr 03 '18 07:04 csc5k

I think we already have an issue filed for this

xrmx avatar Apr 03 '18 08:04 xrmx

OK, I wasn't able to find it when searching. If I find it I'll merge

csc5k avatar Apr 03 '18 10:04 csc5k

Currently this can be done using a macro Jinja in the custom WHERE clause.

This is an example, put in Custom WHERE clause

name = '{{current_user_id()}}'

and the resulting query will be:

where name = 'admin'.

Obviously it would be much clearer to have a direct option in the filters

afullana avatar Apr 08 '18 08:04 afullana

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Apr 11 '19 00:04 stale[bot]

Any possibility that we can get this feature?

gokumar avatar Mar 01 '23 06:03 gokumar