Skip to Content

Remember that to use UME in your WebDynpro components, you should add references to following DC’s

  • com.sap.security.api.sda
  • security_api

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

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. joseph fryda
    Clear and Simple. Thank you.
    However when i’m using:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    sapUser returns me the “portal user” and the “sap user”…why?
    Thank a lot for this weblog.
    Joseph Fryda
    (0) 
    1. Hello,

      I am not sure about which “sap user” do you speak about. Let’s clear things up

      1) User management API is responsible for manageing users in SAP Web Application Server Java. (let’s call it “SAP-Java user”)

      2) Enterprise Portal runs on top of the SAP WAS Java, and as such, it uses WAS Java user management. (so the “Portal user” is the same as “SAP-Java User”)

      3) If you need access to user mapping functions, available in the portal – to get the user name mapped for any (including SAP WAS ABAP or R/3 in general) system defined in portal, you need to use IUserMapping interface, which is described in the UME API. I assume this is what you call the “sap user”.

      I hope now all is clear.


      regards
      Marcin

      (0) 

Leave a Reply