cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

how do share the dashboard to user with Limit the data access

boopa45
Visitor

how do share the dashboard to user with Limit the data access without create a new dashboard with filler in source qry?

is there any other way?

example,

I have a dashboard it contains 3 location data example

India 

Canada

USA

I need to give limited acces to below users

India - User1

Canada - User2

USA - User3

if i give view access to User1 then user1 can view/work with India data only. other country data user2 should not have access. 

pls let me know.

 

2 REPLIES 2

Raman_Unifeye
Contributor III

Use Row-Level Security (RLS)

Instead of filtering the dashboard widgets, you filter the underlying data based on who is looking at it. When User1 opens the dashboard, the database only sends "India" data. When User2 opens the exact same dashboard, the database only sends "Canada" data.

Link for row level filtering https://docs.databricks.com/aws/en/data-governance/unity-catalog/filters-and-masks/


RG #Driving Business Outcomes with Data Intelligence

nayan_wylde
Esteemed Contributor

  1. Use Row-Level Security (RLS) with Unity Catalog: If your dashboard is built on tables governed by Unity Catalog, you can define row filters at the table level. This ensures that users only see rows they are authorized to view, regardless of the dashboard.

        How it works: 

  • Create a row filter function in Unity Catalog.
  • Attach it to the table using ALTER TABLE ... SET ROW FILTER.
  • The filter checks the user identity (e.g., current_user() or is_account_group_member()).
CREATE FUNCTION location_filter() RETURNS BOOLEAN
RETURN location = CASE current_user()
    WHEN 'user1@company.com' THEN 'India'
    WHEN 'user2@company.com' THEN 'Canada'
    WHEN 'user3@company.com' THEN 'USA'
END;

   2. Dynamic Views: If Unity Catalog is not enabled, you can create secure views that apply filters based on the       user context.

Example:

CREATE OR REPLACE VIEW sales_filtered AS
SELECT *
FROM sales_data
WHERE location = CASE current_user()
    WHEN 'user1@company.com' THEN 'India'
    WHEN 'user2@company.com' THEN 'Canada'
    WHEN 'user3@company.com' THEN 'USA'