<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Databricks AI/BI Get Session User in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/170264#M56266</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Short answer: No. There's no built-in function or parameter that returns the viewer's identity while a dashboard runs on the publisher's credentials.&lt;/P&gt;&lt;P&gt;Why: When you publish with Share data permissions (the default, formerly called "Embed credentials"), every query runs as the publisher. So CURRENT_USER() and IS_ACCOUNT_GROUP_MEMBER() check the publisher, not the viewer. That's why row-level security (RLS) logic based on those functions sees the owner.&lt;/P&gt;&lt;P&gt;Workarounds, depending on who your viewers are:&lt;/P&gt;&lt;P&gt;1. Publish with Individual data permissions (best for internal users)&lt;/P&gt;&lt;P&gt;With this option, queries run as each viewer, so CURRENT_USER() returns the viewer. Compute still runs on the publisher's credentials, so viewers don't need access to the SQL warehouse. They only need access to the data. You can then enforce RLS in Unity Catalog:&lt;/P&gt;&lt;P&gt;sql&lt;BR /&gt;-- Mapping table: who can see which region&lt;BR /&gt;CREATE TABLE sec.user_region_map (user_email STRING, region STRING);&lt;/P&gt;&lt;P&gt;-- Row filter&lt;BR /&gt;CREATE OR REPLACE FUNCTION sec.region_filter(row_region STRING)&lt;BR /&gt;RETURN IS_ACCOUNT_GROUP_MEMBER('finance_all')&lt;BR /&gt;OR EXISTS (&lt;BR /&gt;SELECT 1 FROM sec.user_region_map m&lt;BR /&gt;WHERE m.user_email = CURRENT_USER()&lt;BR /&gt;AND m.region = row_region&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;ALTER TABLE sales.orders SET ROW FILTER sec.region_filter ON (region);&lt;/P&gt;&lt;P&gt;Another option is a dynamic view that joins to the mapping table on CURRENT_USER(). Grant viewers SELECT on the view only, not on the base table. That way they can't get around the filter by querying the table directly.&lt;/P&gt;&lt;P&gt;Tips:&lt;/P&gt;&lt;P&gt;Test with a non-admin account.&lt;BR /&gt;Draft dashboards always use the viewer's own permissions, so check the published version.&lt;BR /&gt;IS_ACCOUNT_GROUP_MEMBER() looks at account-level groups, not workspace-local ones.&lt;/P&gt;&lt;P&gt;2. If you must keep Share data permissions&lt;/P&gt;&lt;P&gt;There's no supported way to get the viewer's identity in SQL in this mode. Don't use dashboard filters or parameters as a security control, because viewers can change them.&lt;/P&gt;&lt;P&gt;3. If you embed the dashboard in your own app&lt;/P&gt;&lt;P&gt;With external embedding, your backend creates a signed token that includes an external_value. Your dashboard SQL can read that value as __aibi_external_value, and viewers can't change it. Queries still run as the service principal, so CURRENT_USER() won't help here. But __aibi_external_value gives you a trusted per-viewer value to filter on, for example WHERE viewer_scope = __aibi_external_value against an entitlements table. Databricks published a full reference pattern for this in September 2026 (linked below), including internal users via Databricks Apps.&lt;/P&gt;&lt;P&gt;Roadmap: I'm not aware of any public commitment to add a viewer-identity function for shared-credential dashboards. I'd suggest raising it through the Databricks Ideas Portal or with your account team.&lt;/P&gt;&lt;P&gt;References:&lt;/P&gt;&lt;P&gt;Share a dashboard (&lt;A href="https://docs.databricks.com/aws/en/dashboards/share/share" target="_blank"&gt;Databricks docs&lt;/A&gt;)&lt;BR /&gt;Beyond embedding: &lt;A href="https://www.databricks.com/blog/beyond-embedding-how-secure-aibi-dashboards-every-viewer" target="_blank"&gt;How to secure AI/BI Dashboards for every viewer&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.databricks.com/blog/how-embed-databricks-aibi-dashboards-customer-facing-applications" target="_blank"&gt;How to embed AI/BI Dashboards in customer-facing applications&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2026 16:06:52 GMT</pubDate>
    <dc:creator>Islam_hoti</dc:creator>
    <dc:date>2026-09-30T16:06:52Z</dc:date>
    <item>
      <title>Databricks AI/BI Get Session User</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/169631#M56133</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am currently working with Databricks AI/BI Dashboards and I have a specific requirement regarding user context.&lt;/P&gt;&lt;P&gt;I need to dynamically capture the "session user" (the person who is currently viewing the dashboard) rather than the "execution user" (the owner/creator of the dashboard). My goal is to use this information to apply row-level security based on who is accessing the panel.&lt;/P&gt;&lt;P&gt;I know about the CURRENT_USER() function, but I would like to know:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Is there a specific built-in parameter or function to strictly get the viewer's email/username even if the dashboard is running with owner credentials?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If this is not currently possible, is there any known workaround, or is this feature on the product roadmap?&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2026 21:46:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/169631#M56133</guid>
      <dc:creator>mmsanteago</dc:creator>
      <dc:date>2026-09-23T21:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks AI/BI Get Session User</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/169642#M56135</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/260482"&gt;@mmsanteago&lt;/a&gt;&amp;nbsp;with Share data permissions, queries run using the publisher's permissions, so viewer-based RLS does not apply. Honestly, I'm not aware of a supported dashboard parameter or SQL function that exposes the actual viewer while keeping that execution model.&lt;/P&gt;&lt;P&gt;If per-user security is required, Individual data permissions is the supported approach. Each viewer then queries with their own credentials, and Unity Catalog row filters and column masks are enforced for that viewer.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2026 03:09:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/169642#M56135</guid>
      <dc:creator>ivanvyd</dc:creator>
      <dc:date>2026-09-24T03:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks AI/BI Get Session User</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/170258#M56264</link>
      <description>&lt;P&gt;Hi, good question. This comes down to how the dashboard is published.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Why current_user() returns the owner&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;When you publish an AI/BI dashboard you choose one of two data permission modes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Share data permissions (default):&lt;/STRONG&gt; every viewer's queries run with the publisher's credentials. &lt;CODE&gt;current_user()&lt;/CODE&gt;, &lt;CODE&gt;is_account_group_member()&lt;/CODE&gt; and any Unity Catalog row filters or column masks are evaluated against the publisher, not the viewer.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Individual data permissions:&lt;/STRONG&gt; each viewer's queries run with their own credentials. &lt;CODE&gt;current_user()&lt;/CODE&gt; returns the viewer, and Unity Catalog row filters and column masks are applied per viewer automatically. Compute access is still provided through the publisher, so viewers don't need permission on the warehouse, only on the data.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;There's no separate built-in function or parameter that returns the viewer's identity while the dashboard runs with shared (owner) credentials.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Recommended approach: Individual data permissions plus a Unity Catalog row filter&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Put the security logic on the table, not in the dashboard, so it also applies to anyone querying the table directly. For example, with a mapping table of user or group to region:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;CREATE OR REPLACE FUNCTION sec.region_filter(region STRING)
RETURN is_account_group_member('finance_all')
  OR EXISTS (
    SELECT 1 FROM sec.user_region_map m
    WHERE m.region = region
      AND (m.principal = current_user() OR is_account_group_member(m.principal))
  );

ALTER TABLE sales.orders SET ROW FILTER sec.region_filter ON (region);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE&gt;is_account_group_member()&lt;/CODE&gt; checks account-level groups, so use groups synced from Entra ID or created at account level.&lt;/P&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;Grant viewers &lt;CODE&gt;USE CATALOG&lt;/CODE&gt;, &lt;CODE&gt;USE SCHEMA&lt;/CODE&gt; and &lt;CODE&gt;SELECT&lt;/CODE&gt; on the table, plus &lt;CODE&gt;SELECT&lt;/CODE&gt; on the mapping table (or wrap it in a view). Granting to a group is easiest. In individual mode, viewers without data access will see errors instead of results.&lt;/LI&gt;
&lt;LI&gt;Republish the dashboard and choose &lt;STRONG&gt;Individual data permissions&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Share it with the relevant users or groups.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;How to verify&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Add a temporary dataset: &lt;CODE&gt;SELECT current_user() AS viewer, is_account_group_member('finance_all') AS in_finance&lt;/CODE&gt;, and put it in a counter or table widget.&lt;/LI&gt;
&lt;LI&gt;Open the published dashboard as a test user (or ask a colleague). It should show their email, not yours. If it shows the publisher, the dashboard is still published with shared data permissions.&lt;/LI&gt;
&lt;LI&gt;Check that the row counts differ between two users with different mappings.&lt;/LI&gt;
&lt;LI&gt;Draft dashboards always run with the viewer's permissions, so make sure you test the published version.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Things to avoid&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Don't pass the user's email as a dashboard parameter or filter for security. Viewers can change it, so it's fine for convenience but not for access control.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you need shared credentials (e.g. viewers must not have direct table access)&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For dashboards embedded in your own app for external users, the supported pattern is &lt;CODE&gt;__aibi_external_value&lt;/CODE&gt;. Your backend signs a viewer-specific value into the embed token, and your dataset SQL filters on it. Viewers can't tamper with it.&lt;/LI&gt;
&lt;LI&gt;Otherwise, a common workaround is to keep individual permissions but point viewers at a secure view rather than the base table. The view filters on &lt;CODE&gt;current_user()&lt;/CODE&gt; / &lt;CODE&gt;is_account_group_member()&lt;/CODE&gt;, so users only get &lt;CODE&gt;SELECT&lt;/CODE&gt; on the view.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Roadmap&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I'm not aware of any public roadmap item that exposes the viewer's identity under shared data permissions. If it matters for your use case, raise it with your Databricks account team or through the Azure Databricks feedback portal so it's tracked.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Docs&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Publishing modes and shared data permissions: &lt;A href="https://learn.microsoft.com/en%20us/azure/databricks/dashboards/share/share" target="_self"&gt;https://learn.microsoft.com/en us/azure/databricks/dashboards/share/share&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Row-level security in dashboards: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dashboards/manage/#row-level-security" target="_self"&gt;https://learn.microsoft.com/en-us/azure/databricks/dashboards/manage/#row-level-security&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Unity Catalog row filters and column masks: &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/tables/row-and-column-filters" target="_self"&gt;https://learn.microsoft.com/en-us/azure/databricks/tables/row-and-column-filters&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Embedding for external users (&lt;CODE&gt;__aibi_external_value&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/dashboards/share/embedding/external-embed" target="_self"&gt;https://learn.microsoft.com/en-us/azure/databricks/dashboards/share/embedding/external-embed&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Worked example of per-viewer security: &lt;A href="https://www.databricks.com/blog/beyond-embedding-how-secure-aibi-dashboards-every-viewer" target="_self"&gt;https://www.databricks.com/blog/beyond-embedding-how-secure-aibi-dashboards-every-viewer&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 30 Sep 2026 14:15:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/170258#M56264</guid>
      <dc:creator>datarich</dc:creator>
      <dc:date>2026-09-30T14:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks AI/BI Get Session User</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/170264#M56266</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Short answer: No. There's no built-in function or parameter that returns the viewer's identity while a dashboard runs on the publisher's credentials.&lt;/P&gt;&lt;P&gt;Why: When you publish with Share data permissions (the default, formerly called "Embed credentials"), every query runs as the publisher. So CURRENT_USER() and IS_ACCOUNT_GROUP_MEMBER() check the publisher, not the viewer. That's why row-level security (RLS) logic based on those functions sees the owner.&lt;/P&gt;&lt;P&gt;Workarounds, depending on who your viewers are:&lt;/P&gt;&lt;P&gt;1. Publish with Individual data permissions (best for internal users)&lt;/P&gt;&lt;P&gt;With this option, queries run as each viewer, so CURRENT_USER() returns the viewer. Compute still runs on the publisher's credentials, so viewers don't need access to the SQL warehouse. They only need access to the data. You can then enforce RLS in Unity Catalog:&lt;/P&gt;&lt;P&gt;sql&lt;BR /&gt;-- Mapping table: who can see which region&lt;BR /&gt;CREATE TABLE sec.user_region_map (user_email STRING, region STRING);&lt;/P&gt;&lt;P&gt;-- Row filter&lt;BR /&gt;CREATE OR REPLACE FUNCTION sec.region_filter(row_region STRING)&lt;BR /&gt;RETURN IS_ACCOUNT_GROUP_MEMBER('finance_all')&lt;BR /&gt;OR EXISTS (&lt;BR /&gt;SELECT 1 FROM sec.user_region_map m&lt;BR /&gt;WHERE m.user_email = CURRENT_USER()&lt;BR /&gt;AND m.region = row_region&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;ALTER TABLE sales.orders SET ROW FILTER sec.region_filter ON (region);&lt;/P&gt;&lt;P&gt;Another option is a dynamic view that joins to the mapping table on CURRENT_USER(). Grant viewers SELECT on the view only, not on the base table. That way they can't get around the filter by querying the table directly.&lt;/P&gt;&lt;P&gt;Tips:&lt;/P&gt;&lt;P&gt;Test with a non-admin account.&lt;BR /&gt;Draft dashboards always use the viewer's own permissions, so check the published version.&lt;BR /&gt;IS_ACCOUNT_GROUP_MEMBER() looks at account-level groups, not workspace-local ones.&lt;/P&gt;&lt;P&gt;2. If you must keep Share data permissions&lt;/P&gt;&lt;P&gt;There's no supported way to get the viewer's identity in SQL in this mode. Don't use dashboard filters or parameters as a security control, because viewers can change them.&lt;/P&gt;&lt;P&gt;3. If you embed the dashboard in your own app&lt;/P&gt;&lt;P&gt;With external embedding, your backend creates a signed token that includes an external_value. Your dashboard SQL can read that value as __aibi_external_value, and viewers can't change it. Queries still run as the service principal, so CURRENT_USER() won't help here. But __aibi_external_value gives you a trusted per-viewer value to filter on, for example WHERE viewer_scope = __aibi_external_value against an entitlements table. Databricks published a full reference pattern for this in September 2026 (linked below), including internal users via Databricks Apps.&lt;/P&gt;&lt;P&gt;Roadmap: I'm not aware of any public commitment to add a viewer-identity function for shared-credential dashboards. I'd suggest raising it through the Databricks Ideas Portal or with your account team.&lt;/P&gt;&lt;P&gt;References:&lt;/P&gt;&lt;P&gt;Share a dashboard (&lt;A href="https://docs.databricks.com/aws/en/dashboards/share/share" target="_blank"&gt;Databricks docs&lt;/A&gt;)&lt;BR /&gt;Beyond embedding: &lt;A href="https://www.databricks.com/blog/beyond-embedding-how-secure-aibi-dashboards-every-viewer" target="_blank"&gt;How to secure AI/BI Dashboards for every viewer&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.databricks.com/blog/how-embed-databricks-aibi-dashboards-customer-facing-applications" target="_blank"&gt;How to embed AI/BI Dashboards in customer-facing applications&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2026 16:06:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-ai-bi-get-session-user/m-p/170264#M56266</guid>
      <dc:creator>Islam_hoti</dc:creator>
      <dc:date>2026-09-30T16:06:52Z</dc:date>
    </item>
  </channel>
</rss>

