Skip to Content
author's profile photo Former Member
Former Member

Authorization in Webdynpro applications?

Hi,

I read about How to manage authorization in Webdynpros. It talks about the hasPermission method, which is linked to actions, which is further linked to Roles.

Is there any direct method which can be used to access the Role of the current user which can later be used to restrict the Visibility of certain UI Elements in the Webdynpro application.

Can the method "isMemberOfRole" be of any significant use?

Regards

Meesum

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jul 26, 2005 at 06:46 AM

    hi

    you can get the userid of the logged in user and his role from webdynpro using the following code

    IUser user = request.getUser();

    Iterator roles = user.getRoles(true);

    while (roles.hasNext()) {

    try {

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

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

    if(userRole.getDisplayName().equalsIgnoreCase("elearningclient"))

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

    } catch (Exception e) {

    response.write(""+e);

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 26, 2005 at 06:48 AM

    Hi Meesum,

    You can make use of following

    user.getSAPUser().isMemberOfGroup();

    Example :

    IWDClientUser user = WDClientUser.getCurrentUser();

    IUser userID = user.getSAPUser();

    String Userrole=new String();

    for (Iterator iter = userID.getRoles(true); iter.hasNext();) {

    IRole role = UMFactory.getRoleFactory().getRole((String) iter.next());

    Userrole=role.getUniqueName();

    }

    if(Userrole.equalsIgnoreCase("Administrator"))

    // TO DO

    Regards, Anilkumar

    Message was edited by: Anilkumar Vippagunta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 26, 2005 at 10:25 AM

    Hi Meesum

    If you want the authorization for the individual UI elements , You need to go with Java permissions.

    For getting all the Roles of the logged in user, Use

    UMFactory.getRoleFactory()..

    Regards

    NagaKishore V

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.