授权用户使用 ITIM 中分配的组
我是 ITIM 的新手。我正在开发一个 JAVA 应用程序。我想根据用户分配到的组来授权用户。我怎样才能做到这一点?
是否有任何 api 可以获取用户角色/组并通过它们进行授权?
I am new to ITIM. I am working on an application in JAVA. I want to authorize users based on groups they are assigned to. How can I do that?
Is there any api that can fetch user roles/groups by which I can authorize them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
系统用户会有一个'erroles'属性,通过它我们可以获取用户组/角色的信息。
从Person对象获取DistinguishedName。使 PersonMO 对象具有类似于
new PersonMO(platform, subject, person.getDistinguishedName());
的构造函数Make
new AccountManager(platform, subject);
这将为帐户集合
accountManager.getAccounts(personMO, LocaleCreator.getLocale());
获取 getSystemUserDN(userId);。 PersonDao 类将有助于实现这一点。
Make
new SystemUserMO(m_platform, m_subject, new DistinguishedName(systemUserDN));
从
systemUserMO.getData().getRoles()
获取角色/组干杯 Imran Tariq
The system user will have an attribute of ‘erroles’ through which we can get information of user groups/Roles.
Get DistinguishedName from Person object. Make PersonMO object having constructor like
new PersonMO(platform, subject, person.getDistinguishedName());
Make
new AccountManager(platform, subject);
This will give accounts collection
accountManager.getAccounts(personMO, LocaleCreator.getLocale());
Get getSystemUserDN(userId);. PersonDao class will help in getting this.
Make
new SystemUserMO(m_platform, m_subject, new DistinguishedName(systemUserDN));
Get the roles/Groups from
systemUserMO.getData().getRoles()
Cheers Imran Tariq