Question

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.

Was it helpful?

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 {}
    }
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top