on 07-28-2005 9:52 AM
Can anybody throw light on the purpose of the method
isMemberOfRole in the IUser class?
I have been trying to use it to compare user roles but without success.
IUser usr = WDClientUser.getCurrentUser().getSAPUser();
if(usr.isMemberOfRole("Test_Role",true))
{.....}
hi Meesum,
Go to user administration>roles in Portal
click start
It lists all the roles.The first column is the id.Identify the id of the role you want to check.Try giving it in isMemberOfRole()
Hope this helps you
Regards,
Rohit.
Message was edited by: Rohit Radhakrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cut-n-paste from API documentation:
<i>Checks if the principal belongs to the passed roleId This method does a recursive search if parameter recursive is set to true. If this user belongs to a group which is a member of a role, true is returned.</i>
<b>Parameters:</b>
uniqueIdOfRole - identifying the role
recursive - if true checks also all parent groups
<b>Returns:</b>
true if this user is directly or indirectly (via role membership) assigned.
VS
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.
Hi Meesum,
IUser.isMemberOfRole() takes the first parameter as the UniqueId of the role. I think the value you are providing is the display name for the role.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this code
IWDClientUser user = WDClientUser.getCurrentUser();
IUser userID = user.getSAPUser();
String Userrole=new String();
for (Iterator iter = userID.getRoles(true); iter.hasNext();) {
IRole role = UMFactory.getRoleFactory().getRole((String) iter.next());
Userrole=role.getUniqueName();
}
You can use user.getSAPUser().isMemberOfGroup() method also
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.