cancel
Showing results for 
Search instead for 
Did you mean: 

webdynpro security

Former Member
0 Kudos

Hi experts,

how can I create a webdynpro avaliable only for certains roles?

thanks in advance,

david

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

thanks very much

david

former_member188498
Active Participant
0 Kudos

Hi David,

besides defining roles for web dynpro iviews, you can also check if current user belongs

to the specified role from code and if doesn't, you can then take appropriate actions (hide buttons, controls, display message etc):

For example with this function:


	/**
	 * Method checks if current user belongs to role.
	 * @param roleUniqueID unique role id (eg. "pcd:portal_content/Company_Content/Project/Roles/com.company.project.rolename")
	 * @return true if user belongs to role, false if not
	 */
	public boolean checkCurrentUserBelongsToRole(String roleUniqueID)
	{
		boolean userMemberOfRole = false;

		IUser sapUser = null;

		try
		{
			//get role from role unique id
			IRole sapRole = UMFactory.getRoleFactory().getRoleByUniqueName(roleUniqueID);
			
			// get webdynpro user
			IWDClientUser wdcu = WDClientUser.getCurrentUser();
			
			// get sap WAS user for WD user
			sapUser = wdcu.getSAPUser();
						
			// check if user is member of role
			userMemberOfRole = sapRole.isUserMember(sapUser.getUniqueID(), true);

		}
		catch (Exception e)
		{
			wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
		}		
		
		return userMemberOfRole;
	}

Hope this helps,

Ladislav

Message was edited by:

Armin Reichert

Former Member
0 Kudos

Hi,

can I make this without the Portal?

david

Former Member
0 Kudos

Hi,

thanks for yours anwers.

I can create a iview from portal and assign this to certains users. But the webdynpro is accessible for everyone.

thanks in advance,

david

Former Member
0 Kudos

There is something called as roles in portal as well. If u have multiple applicatios, say 4 in number. and you want 1 person to access just 3 appplications, u can create a user for that and create iviews for different roles under one user. or u can have multiple users if you want to make each of your application secure. Make 1 user for each application and create an iview for that user in the default role.

Former Member
0 Kudos

Hi

1) Create a webdynpro iview

2) Assign that iview to only role which you want,

Regards

Hemant

Message was edited by:

Armin Reichert

Former Member
0 Kudos

Hi hemant,

Check this url & go thru other portal configuration docs.It will help.

<a href="http://help.sap.com/saphelp_nw70/helpdata/en/59/bf2287b3cb5e48af94f99929ad15b9/frameset.htm">http://help.sap.com/saphelp_nw70/helpdata/en/59/bf2287b3cb5e48af94f99929ad15b9/frameset.htm</a>

regards

Sumit

Former Member
0 Kudos

Hi David,

What is your actual requirement.

With Regards

Balaram Naidu