Jump to content
  • how to create a 'contains' syntax for principalExpression in domain security file


    ghudson_1
    • Features: Domains Version: v7.5 Product: JasperReports® Server

    Issue Description

    In a domain security file's principalExpression element, the typical example checks to see if a user's role is in a list of the roles provided, like:

    authentication.getPrincipal().getRoles().any{ it.getRoleName() in ['ROLE_T_1, ROLE_T_2, ROLE_T_3, ROLE_T_99999'] ...

    See https://community.jaspersoft.com/documentation/tibco-jasperreports-server-security-guide/v7/domain-and-security-recommendations for reference

    But some users might want to check to see if any of a user's roles simply contain ROLE_T, for simplicity.  

    Resolution

    It is possible to use this expression in your principalExpression element:

    authentication.getPrincipal().getRoles().contains('ROLE_T')

    If any of the users's roles contain ROLE_T as part of the rolename, the expression will return true.

    Ref. Case 01854677/strong>


    User Feedback

    Recommended Comments

    There are no comments to display.



    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...