cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

User able to Edit the Power BI Report in Javascript SDK with Embed Token Genereated for View only

I have embedded the power bi report using service principal as given here.

I'm generating the embed token as below,

var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel:"View",allowSaveAs:false,identities: new EffectiveIdentity[] { new EffectiveIdentity(username: serviceAccount, roles: new string[] { "Viewer" }, datasets: new string[] { report.DatasetId }) });
EmbedToken embedToken = client.Reports.GenerateTokenInGroup(groupId, reportId, generateTokenRequestParameters);

But when I embed the report using javascript sdk, if I configure the permission as below the user able to edit the reports. How can prevent the user from editing the report in the embed token?

permissions: models.Permissions.ReadWrite,
viewMode: models.ViewMode.Edit,

 

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: User able to Edit the Power BI Report in Javascript SDK with Embed Token Genereated for View onl

Hi @joecorestack ,

 

You may modify above code as below to grant read-only permission. 

permissions: models.Permissions.Read,
viewMode: models.ViewMode.View,

For detailed description and sample code, please see: Embed Configuration Details

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: User able to Edit the Power BI Report in Javascript SDK with Embed Token Genereated for View onl

Hi @v-yulgu-msft ,

 

   Thanks for your reply. But some one can potentially change the line as below and update the report.

 

permissions: models.Permissions.ReadWrite,
viewMode: models.ViewMode.Edit,

 

Thanks

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (679)