Hey there, I’m attempting to build a rental management app that’s not only for Admin and Managers but for Clients and Tenants as well.
- Admins should see everything.
- Managers should see rentals, clients and tenants.
- Clients should see their rentals and tenants.
I grabbed this formula from a timecard demo and it worked but I don’t think it’s the final solution.
IFS( ANY(CURRENT_USER[ROLE]) = 'ADMIN', TRUE, ANY(CURRENT_USER[ROLE]) = 'MANAGER', OR( [USER] = USEREMAIL(), AND( [USER].[REGION] = ANY(CURRENT_USER[REGION]), [USER].[ROLE] = 'CLIENT' AND( [USER].[REGION] = ANY(CURRENT_USER[REGION]), [USER].[ROLE] = 'TENANT' ) ) ), TRUE, [USER] = USEREMAIL() )
In a perfect scenario, I wouldn’t need the User, Role or Region in EVERY data table because the system would verify the UserEmail matches the address attached to the UserEmail of the Users Data table. I can’t for the life of me figure out how to write the formula to reference the ‘Users’ Data Table even after creating a Current_User slice sourced from that data. Any help and direction is appreciated!