Remember that to use UME in your WebDynpro components, you should add references to following DC’s
The most important thing is that every object in WAS Java User Management Engine (UME) is based on a general interface – IPrincipal. The data we manipulate – group, user and role are available trough the IUser, IGroup and IRole interfaces, which are descendants of the IPrincipal interface.
Access to all the objects of UME is done using a static class – com.sap.security.api.UMFactory
This class provides standard methods for getting user, role and group factory and also other objects, like the SecurityManager.
WebDynpro user management is built somehow on top of the standard WAS UME. The basic class for the developer is the WDClientUser. It provides a static method, getClientUser() which returns the user currently logged on to the application. The user is an object implementing IWDClientUser interface, providing the method getSAPUser(), which returns the IUser object (a real WAS UME user).
Besides fetching the current user, one can access all available functions and methods – look at the linked URL to the UserManagement API.
To your convinience two source snippets are attached. The first one allows you to check wether the user is assigned to the specified role. A simple and effective way to perform authorizations checks, without building Permission objects and deploying them to the server. (however, it is not very nice to do so 😉
The second one is a simple implementation of a user search engine for WebDynpro – just add some context and a table view, and you have a working who-is-who. 🙂
Checking if user is assigned to role
Simple user search for a given phrase