on 09-27-2008 8:13 AM
Hi Experts,
I have used the below code to get the roles assigned to a particular user.
I need to find whether my role Role:A is in the list.
If it is present in the list then i have to perform some activity like hidding some fileds from the view and displaying others.
IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();
IUser user = wdUser.getSAPUser();
String strRoleID = "", strRoleDesc = "";
IRoleFactory iRoleFactory;
iRoleFactory = UMFactory.getRoleFactory();
// Get All the Roles of the User
Iterator iteratorRoles = user.getRoles(true);//prtRequest.getUser().getRoles(true);
// Loop through all the Roles
while(iteratorRoles.hasNext())
{
strRoleID = iteratorRoles.next().toString();
try
{
strRoleDesc = iRoleFactory.getRole(strRoleID).getDescription();
String str = "ALSS";
if((strRoleDesc).trim().equals(str))
{
wdContext.currentContextElement().setSecondCont(WDVisibility.VISIBLE);
wdContext.currentContextElement().setDebug("1");
}
else
{
wdContext.currentContextElement().setSecondCont(WDVisibility.BLANK);
When i use this my code goes to the else part. And I have checked that the role ALSS is present in the list. Please advice where i am going wrong.
Points will be given for helpful answers.
Regards,
Sanjyoti.
hi !
pleasse refer to the following link
http://help.sap.com/saphelp_nw04/helpdata/en/f5/4dd9d47a200d46bd1c56062f49e10b/frameset.htm
thanks
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Thank you for ur reply.
In this case the user will have authentication to use the application.
But depending on the role attached to the user i will display some particular fields to one user and other fields to other users.
ROLE :A App-->Element 1
ROLE: B App->Element 2
In this case the App ie. the application is the same just the elements displayed differs.
Regards,
Sanjyoti.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.