用于CORBA命名服务组映射的Jython或JACL

时间:2012-03-19 19:11:03

标签: websphere jndi jython corba jacl

我正在使用 IBM WebSphere 7.0

我想将 CORBA命名服务组 EVERYONE映射到Cos Naming WriteCos Naming Read个角色。如何使用 Jython JACL ?请提供一些线索,代码段或指向大量 Jython 文档的链接。

1 个答案:

答案 0 :(得分:2)

这不是很安全,所以我假设你是为了开发或在某种防火墙之后做这件事。这个Jacl片段应该做你想要的:

# 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 {}
    }
  }
}