<?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: Need help implementing row-level security (RLS) with embedded analytics in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/262049#M8074</link>
    <description>&lt;P&gt;Sorry I didn't get notice earlier of your post. Here is my code that works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view", identities: new List&amp;lt;EffectiveIdentity&amp;gt; { new EffectiveIdentity(username: userId, roles: new List&amp;lt;string&amp;gt; { role }, datasets: new List&amp;lt;string&amp;gt; { DatasetId }) });

                var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(GroupId, report.Id, generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;Obviously userId, role, DatasetId and GroupId are string variables. Make sure your role is setup in the Power BI workbook.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Oct 2017 06:26:42 GMT</pubDate>
    <dc:creator>craigduffy</dc:creator>
    <dc:date>2017-10-01T06:26:42Z</dc:date>
    <item>
      <title>Need help implementing row-level security (RLS) with embedded analytics</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252170#M7792</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like Microsoft&amp;nbsp;just added some functionality to the GenerateToken API so that you can pass additional context for RLS as a part of your embed token:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedded-rls/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedded-rls/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone happen to have a simple working example of this that they can share? &amp;nbsp;I just want to pass one user, role and dataset, but I don't know how to determine the dataset ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, if this is a dumb question, but &lt;STRONG&gt;how do I determine what the id is for the dataset of my report?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 18:13:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252170#M7792</guid>
      <dc:creator>datavigilante</dc:creator>
      <dc:date>2017-09-14T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help implementing row-level security (RLS) with embedded analytics</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252226#M7794</link>
      <description>&lt;P&gt;I had the same question. Just figured it out: Similar to getting the group Id. In your power bi portal, click on the app workspace. Then select the Datasets tab on top. Select the dataset that matches your report (or view Settings) then copy the guid from the url after /datasets/. &amp;nbsp;Copy that to your code and that should do it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 19:41:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252226#M7794</guid>
      <dc:creator>craigduffy</dc:creator>
      <dc:date>2017-09-14T19:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help implementing row-level security (RLS) with embedded analytics</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252237#M7795</link>
      <description>&lt;P&gt;That's awesome, thanks Craig.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have it working, would you mind sharing your GenerateToken API syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble getting the &lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedded-rls/" target="_blank"&gt;code provided&lt;/A&gt; for the&amp;nbsp;&lt;A href="https://github.com/Microsoft/PowerBI-Developer-Samples/tree/master/App%20Owns%20Data" target="_blank"&gt;PowerBIEmbedded_AppOwnsData&lt;/A&gt;&amp;nbsp;sample to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List&amp;lt;EffectiveIdentity&amp;gt; { new EffectiveIdentity(username: "username", roles: new List&amp;lt;string&amp;gt; { "roleA", "roleB" }, datasets: new List&amp;lt;string&amp;gt; { "datasetId" }) });

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("groupId", "reportId", generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;Like I said, I will only have one role and dataset. &amp;nbsp;Also, I don't understand why groupID and reportID are in quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 20:01:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/252237#M7795</guid>
      <dc:creator>datavigilante</dc:creator>
      <dc:date>2017-09-14T20:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help implementing row-level security (RLS) with embedded analytics</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/253977#M7828</link>
      <description>&lt;P&gt;I think that where I am getting stuck is how to define the EffectiveIdentity object. &amp;nbsp;In my code below, there is a squiggly line under it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest(
                    accessLevel:  "View", 
                    allowSaveAs: null, 
                    identities: new List&amp;lt;EffectiveIdentity&amp;gt; { new EffectiveIdentity(
                        username: "20", 
                        roles: new List&amp;lt;string&amp;gt; { "User" }, 
                        datasets: new List&amp;lt;string&amp;gt; { "07cf5f83-033d-4265-a9a0-5ba476cde601" }) });
var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(GroupId, "a10024dd-907e-4c1c-baed-e12e0a896d6b", generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 12:57:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/253977#M7828</guid>
      <dc:creator>datavigilante</dc:creator>
      <dc:date>2017-09-18T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help implementing row-level security (RLS) with embedded analytics</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/262049#M8074</link>
      <description>&lt;P&gt;Sorry I didn't get notice earlier of your post. Here is my code that works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view", identities: new List&amp;lt;EffectiveIdentity&amp;gt; { new EffectiveIdentity(username: userId, roles: new List&amp;lt;string&amp;gt; { role }, datasets: new List&amp;lt;string&amp;gt; { DatasetId }) });

                var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(GroupId, report.Id, generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;Obviously userId, role, DatasetId and GroupId are string variables. Make sure your role is setup in the Power BI workbook.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2017 06:26:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-implementing-row-level-security-RLS-with-embedded/m-p/262049#M8074</guid>
      <dc:creator>craigduffy</dc:creator>
      <dc:date>2017-10-01T06:26:42Z</dc:date>
    </item>
  </channel>
</rss>

