javasecuritysecurity-rolestivoli-identity-manager

Authorize users w.r.t assigned groups in ITIM


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?


Solution

  • 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