
Hi everyone,
I have added the Security Role entity and the User entity as data sources in a canvas app. I can leverage the relationship between both tables to return the security roles assigned to the user currently logged into the canvas app.
However, I also want to check if if the user has been assigned a specific role/s.
Unfortunately, using a Lookup results in a delegation warning. I think I can use a Collection instead and ignore the delegation warning, but I wanted to check if anyone has a better approach.
Set(
varPermission,
CountRows(
Filter(
LookUp(
Users,
'Primary Email' = User().Email
).'Security Roles (systemuserroles_association)',
Name = "HR_Apps_Administrator" || Name = "System Administrator"
)
) > 0
)
Best regards,
Imran-Ami
Decided to use a hidden Gallery as a workaround.
I applied the following to the Items property of the Gallery:
LookUp(Users,'Primary Email'= User().Email).'Security Roles (systemuserroles_association)'
Then modified the variable to look at the Gallery instead
Set(
varHasPermission,
CountRows(
Filter(
Gallery_SecurityRoles_Hidden.AllItems,
Security_role.Text = "HR_Apps_Administrator" || Security_role.Text = "System Administrator"
)
) > 0
);