webspherejndijythoncorbajacl

Jython or JACL for CORBA naming service groups mapping


I'm using IBM WebSphere 7.0.

I want to map CORBA naming service groups EVERYONE to Cos Naming Write and Cos Naming Read roles. How to do that using Jython or JACL? Please give some clue, code snippet or a link to extensive Jython documentation.


Solution

  • That's not very secure, so I'll assume you're doing this for development or behind a firewall of some kind. This Jacl snippet should do what you want:

    # Loop over all role assignments
    foreach roleAssignmentExt [$AdminConfig list RoleAssignmentExt] {
      set role [$AdminConfig showAttribute $roleAssignmentExt role]
      set roleName [$AdminConfig showAttribute $role roleName]
    
      # Look for the interesting roles.
      if {$roleName == "CosNamingWrite" || $roleName == "CosNamingRead"} {
        # Create an assignment of Everyone isn't already assigned.
        set everyoneRoles [$AdminConfig list EveryoneExt $roleAssignmentExt]
        if {[string length $everyoneRoles] == 0} {
          puts "Adding EveryoneExt to $roleAssignmentExt"
          $AdminConfig create EveryoneExt $roleAssignmentExt {}
        }
      }
    }