Balraj Posted July 15, 2016 Share Posted July 15, 2016 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 XMLTransaction100_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 & RegardsJasperExplorer Link to comment Share on other sites More sharing options...
Solution Balraj Posted July 20, 2016 Author Solution Share Posted July 20, 2016 Got it, the answer is<filterExpression>testCurrentUserRoles(Transaction100_MyTable.RoleName)</filterExpression>[/code]Hope it helps someone..Cheers :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now