on 06-28-2007 5:50 PM
Hi All,
I'm using this code to get the User's group
try
{
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
myGroups = user.getAttribute("com.sap.security.core.usermanagement.relation","PRINCIPAL_RELATION_PARENT_ATTRIBUTE");
}
catch{
}
For some users I'm getting "No Text availble " or nullpointer exception.
The code used to run with je22 sp 13 with no problem but after upgrading to SP19, some user get this message !!!
Thanks,
Amit Yosha
This code returns the iterator containing the user groups. Once you have called it, you have to loop this iterator while hasnext = false.
<b> try{
IWDClientUser clientuser = WDClientUser.getCurrentUser();
IUser user = clientuser.getSAPUser();
Iterator userGroups = null;
userGroups = user.getParentGroups(true);
}
catch(Exception ex){
wdThis.wdGetAPI().getComponent().getMessageManager().raiseMessage( IMessageYSP_CRM_CP_COCKPIT.USER_E , null,true);
}</b>
userGroups has the groups.
Don't forget to loop the iterator in try statement.
Hopes it can work.
Grites!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
It depends where the attrbiute is being saved:
1) If it's saved in LDAP you need to check your dataSourceConfiguration file (check that you have the namespace 'com.sap.security.core.usermanagement.relation' and the property 'PRINCIPAL_RELATION_PARENT_ATTRIBUTE' is properly mapped to physical attribute in the LDAP).
2) If it's saved in the Portal DB, check that the portal actually saves this property for a user (by using setAttribute and then getAttribute...)
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.