How to achieve access control based views in looker?

I have a table of patients and I have created a dashboard based on that. Now what I want is to have a user/group of user to have access to some/all patients based on patient ID's. 

The dashboard must show charts based on data for only patients having access for the logged in user.

How can I achieve this in Looker (not studio)?

Solved Solved
0 1 114
1 ACCEPTED SOLUTION

We have set up our access control based on User Attribute.

Suppose you give each user a User Attribute called "Patient Group ID". That Group Id would correspond to the Group of Patients that the User has access to view.


In the Explorer, add Access filters like this:
access_filter: {
field: sometable.PatientGroupId
user_attribute: patient_group_id
}

Looker will now add this condition to the where clause to any SQL that will run in this query. If you don't want Looker to filter on Patient Group Id, simply replace the User Attribute for that user to %,NULL.

Hope this helps!

View solution in original post

1 REPLY 1

We have set up our access control based on User Attribute.

Suppose you give each user a User Attribute called "Patient Group ID". That Group Id would correspond to the Group of Patients that the User has access to view.


In the Explorer, add Access filters like this:
access_filter: {
field: sometable.PatientGroupId
user_attribute: patient_group_id
}

Looker will now add this condition to the where clause to any SQL that will run in this query. If you don't want Looker to filter on Patient Group Id, simply replace the User Attribute for that user to %,NULL.

Hope this helps!