cancel
Showing results for 
Search instead for 
Did you mean: 

Read all the users assigned to a portal role

lajitha_menon
Contributor
0 Kudos

Hi,

Is there any way I can read all the users assigned to a particular portal role?

thanks

Lm

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use this code:

Iterator rit = null;

IWDClientUser clientUser = WDClientUser.getCurrentUser();

IUser user = clientUser.getSAPUser();

rit = user.getRoles(true);

IRoleFactory rfact = UMFactory.getRoleFactory();

while (rit.hasNext()) {

String roleName = (String) rit.next();

IRole role = rfact.getRole(roleName);

}

Regards,

Rajeev

regards,

Rajeev ranjan

former_member182372
Active Contributor
0 Kudos

Hi LM,

Doesn`t <i>public String[] IRoleFactory.getRolesOfUser(String uniqueIdOfUser, boolean recursive) </i> make it? See https://media.sdn.sap.com/javadocs/NW04/SPS15/um/com/sap/security/api/IRoleFactory.html for JavaDocs.

Best regards, Maksim Rashchynski.

lajitha_menon
Contributor
0 Kudos

Hi Maksim, I need to use the method getUsersOfRole, which should ideally have worked, but we are using ldap for user management, and the call of this method gives an ldap error (no object ).

Any ideas?

Lm

former_member182372
Active Contributor
0 Kudos

Hi LM,

Check http://help.sap.com/saphelp_nw04/helpdata/en/48/d1d13f7fb44c21e10000000a1550b0/frameset.htm especially "Constraints" section. may be you will find your case there.

BTW, what is the LDAP error?

Best regards, Maksim Rashchynski.