Forum Discussion

mp390988's avatar
mp390988
Post Partisan
1 year ago
Solved

How to go about in implementing RLS

Need guidance in implementing row level security on the below Employees table:

 

EmployeeLocal DepartmentDepartmentManager ID
Johnny DeppData AnalyticsFinanceKris Moll
Brad PittData AnalyticsFinanceKris Moll
Matt DamonProduct ControlFinanceMatt Damon
James GreavesProduct ControlFinanceMatt Damon
Roopa NaragrachaMarket DataFinanceFilip Navros
Madhu SaiMarket DataFinanceFilip Navros
Jay PotLiquidity RiskFinanceChalie Ker
George ClooneyLiquidity RiskFinanceChalie Ker
Clive OwenFP&AFinanceClive Owen
Raju SinghFP&AFinanceClive Owen
Chris HelmsworthFP&AFinanceClive Owen
Kelly SmithData AnalyticsFinanceKris Moll

 

 

This is the data model:

 

 

 

Employees who are not a manager, should only see their data. So for example, Johnny Depp is an employee and is not a manager, so he should only see their records.

 

Employees who are a manager should see their data as well the employees they manage. So for example, Clive Owen is an employee with manager status so he should see his records as well Raju Singh and Chris Helmsworth.

 

How do I do this?

  • Hi,

    If you have only two layers it can be handled by following:

    1) Join emails of Employee as "Employee Email" and Manager's as "Manager Email". In the Desktop follow this:

    https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

    2) Here you define 2 roles "Employee" and "Manager"

    3) For employee role you set "Employee Email" == userprincipalname() 

    4) For manager role you set "Manager Email" == userprincipalname() 

    5) Follow RLS configuration in the Power BI Service after publishing

     

5 Replies

  • OktayPamuk80's avatar
    OktayPamuk80
    Responsive Resident

    Hi,

    If you have only two layers it can be handled by following:

    1) Join emails of Employee as "Employee Email" and Manager's as "Manager Email". In the Desktop follow this:

    https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

    2) Here you define 2 roles "Employee" and "Manager"

    3) For employee role you set "Employee Email" == userprincipalname() 

    4) For manager role you set "Manager Email" == userprincipalname() 

    5) Follow RLS configuration in the Power BI Service after publishing

     

  • Hi mp390988 have you tried using PATH and PATHCONTAINS dax ?

    Employees who are a manager should see their data as well the employees they manage.

    PATHCONTAINS([Path], LOOKUPVALUE(data[Employee key], data[email], USERPRINCIPALNAME()))

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mp390988,

     

    we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
    If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Vinay Pabbu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi @mp390988,

       

      we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
      If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

       

      Regards,
      Vinay Pabbu

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi @mp390988,

         

        we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
        If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

         

        Regards,
        Vinay Pabbu