0 Replies Latest reply: Sep 26, 2012 3:55 AM by user34071 RSS

    Problem with adding members to Realm roles in WLST

    user34071
      HI,

      I have a problem when I'm trying to add multiple groups and/or users to a Global Realm role, where the groups and users come from a properties sheet.

      For example, snip from the online WLST code :

      securityRealm = cmo.getSecurityConfiguration().getDefaultRealm()
      roleMapper = securityRealm.lookupRoleMapper('XACMLRoleMapper')

      roleMapper.setRoleExpression('','Monitor','Grp(testGroup)')
      roleMapper.setRoleExpression('','Monitor','Usr(testUser)')

      Now once run testUser over writes the testGroup and it doesn't get appended.

      One solution it to have it on one line:

      roleMapper.setRoleExpression('','Monitor','Grp(testGroup)|Usr(testUser)')

      This works as well.

      The problem comes when the groups and users are dynamically generated from a properties file so the code doesn't know what the groups or users names or how many will be and all has to be on one command or else it gets over written each time another group or user is added.

      Would any one know a solution?