https://learn.microsoft.com/en-us/power-bi/developer/embedded/cloud-rls
Here explains how we could add RLS in our report, and then what should implement in the backend to generate embed token accordingly for the effective identity (role)
this could be an example code:
app.get('/api/getEmbedToken', async (req, res) => { const reportId = req.query.reportId; const groupId = req.query.groupId; const username = req.query.username; const roles = req.query.roles.split(','); try { const embedToken = await getEmbedToken(reportId, groupId, username, roles); res.json({ embedToken }); } catch (error) { res.status(500).send('Error generating embed token'); } });
this could be an example code:
app.get('/api/getEmbedToken', async (req, res) => { const reportId = req.query.reportId; const groupId = req.query.groupId; const username = req.query.username; const roles = req.query.roles.split(','); try { const embedToken = await getEmbedToken(reportId, groupId, username, roles); res.json({ embedToken }); } catch (error) { res.status(500).send('Error generating embed token'); } });