cancel
Showing results for 
Search instead for 
Did you mean: 

get Role,Group based on Username in webdynpro NOT Portal

Former Member
0 Kudos

 public static void wdDoModifyView(IPrivateFormView wdThis, IPrivateFormView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
  {
    //@@begin wdDoModifyView
    
	try {
		
		
	IWDClientUser user = WDClientUser.getCurrentUser();
	
		  String userinfo=user.getClientUserID();
		  String userinfo1=user.getFirstName();
		  String userinfo2=user.getLastName();
				 
			   } catch (WDUMException e) { 
		  e.printStackTrace();
	   }


    
    //@@end
  }

It works fine for this code, but what i need is based on the current login name i am to check the associated userrole and group it belongs to

do i able to do that ?

this code is implemented in webdynpro not portals...

when i place this code in webdynpro implementation section ,

it is a big disaster for me showing error,

i can used : request , response

IUser user=request.getUser();

Iterator roles=user.getRoles(true);

while(roles.hasNext()){

String uniqueID=roles.next().toString();

IRole userRole=UMFactory.getRoleFactory().getRole(uniqueID);

response.write("Role is:" +userRole.getDisplayName());

}catch(Exception e){

response.write("" +e);

}

where this code should implement actually.....i am a beginner...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

Check out this threads

/thread/201169 [original link is broken]

/message/1565111#1565111 [original link is broken]

When using the IUser API add the <b>security</b> jar file to the project by righclick on project->properties->javabuildpath->addexternalJars

Regards,

Gopi

Former Member
0 Kudos