在 WebSphere 7 中创建用户组作为子组(门户)
在 websphere 7 门户服务器上运行的 portlet 中,我想创建一个新用户组,该用户组是现有组的子组。
这是代码(我尽可能缩短以保持焦点):
/* vars */
final PumaController controller = ...;
final PumaLocator locator = ...;
final PumaProfile pumeProfile = ...;
final groupCn = ... ;
/* code to add group */
final List<Group> parent = locator.findGroupsByAttribute("cn", CN_OF_GROUP);
final String parentDn = pumaProfile.getIdentifier(parent.get(0));
log.debug("creating new group with cn=" + groupCn + ", parentDn=" + parentDn);
newGroup = controller.createGroup(groupCn, parentDn, new HashMap<String, Object>(0));
调试语句打印:
创建新组 cn=[组Cn], ParentDn=cn=[CN_OF_GROUP],o=defaultWIMFileBasedRealm
该代码确实创建了一个组。但看起来parentDN 参数被忽略了。该组不是作为父组的子组创建的,而是作为顶级组创建的。 (如果我将 null 作为parentDn 传递,也会发生同样的情况)。
我在这里做错了什么?
In a portlet running on a websphere 7 portal server I want to create a new user group that is a subgroup of an existing group.
Here is the code (that I shortend as much as possible to keep the focus):
/* vars */
final PumaController controller = ...;
final PumaLocator locator = ...;
final PumaProfile pumeProfile = ...;
final groupCn = ... ;
/* code to add group */
final List<Group> parent = locator.findGroupsByAttribute("cn", CN_OF_GROUP);
final String parentDn = pumaProfile.getIdentifier(parent.get(0));
log.debug("creating new group with cn=" + groupCn + ", parentDn=" + parentDn);
newGroup = controller.createGroup(groupCn, parentDn, new HashMap<String, Object>(0));
The debug statement prints:
creating new group with
cn=[groupCn],
parentDn=cn=[CN_OF_GROUP],o=defaultWIMFileBasedRealm
The code DOES create a group. But it looks like the parentDN argument is ignored. The group is not created as a subgroup of parent, but it is created as a top level group. (Which is the same thing that happens if I pass null as parentDn).
What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能什么也没有。如果我是你,我会提出 PMR。
如果您配置了联合安全性而不是独立安全性,请顺便删除基于文件的领域。配置联合安全性时,您应该始终删除它。
Probably nothing. I would raise a PMR if I were you.
If you configured federated security instead of standalone security please delete the file based realm by the way. You should always delete it when configuring federated security.