Limiting sql result to salesperson's own sales

Hello,

I’ve been using Metabase for a while and have been writing SQL queries without much trouble. I’ve run into a case now where I need to restrict the data returned based on the logged-in user.

I want salespeople to only see rows related to their own sales and deliveries. It wouldn’t be appropriate for a salesperson to view other salespeople’s results.

What’s the recommended way to reference the logged-in user in a native SQL query and safely limit the returned rows to only those associated with that user?

2 options:

  1. Pay for the Pro version

  2. Use embedded dashboards and pass the id from a parent page into the dashboard within an Iframe.

To expand on @AndrewMBaines ‘s answer,

The first solution is the Row Level Security feature in the paid versions of Metabase.

The second uses Guest Embedding to create a locked version of the dashboard for just that user. This would work if there is only a few users and they don’t need self-service analytics. More than this gets into the paid version features.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.