我正在使用 IBM WebSphere 7.0 。
我想将 CORBA命名服务组 EVERYONE
映射到Cos Naming Write
和Cos Naming Read
个角色。如何使用 Jython 或 JACL ?请提供一些线索,代码段或指向大量 Jython 文档的链接。
答案 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 {}
}
}
}