Jump to content
We've recently updated our Privacy Statement, available here ×

Fetch User Roles using Groovy Expression to implement Domain Security


Balraj
Go to solution Solved by Balraj,

Recommended Posts

Hi community,

I'm trying to implement Domain Security based on Logged in user Role. I'm facing problems while writing a filter expession. Here is the XML

Transaction100_MyTable.RoleName contains Roles Names in my Database, how to fetch Logged In user Roles and use them in "principalExpression" and "filterExpressions"

<resourceAccessGrant id="JoinTree_1_ROLE_Failed_row_grant">                <principalExpression>authentication.getPrincipal().getRoles().any{ it.getRoleName() in ['ROLE_Failed'] }</principalExpression>                 <filterExpression>Transaction100_MyTable.RoleName in (groovy('authentication.principal.roles.roleName.join(", ").replace(',',"','")'))</filterExpression> </resourceAccessGrant>[/code]

Thanks & Regards

JasperExplorer

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...