cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle screen level visibility depending up on Role of the user

former_member225041
Participant
0 Kudos

Hello experts,

We have a webdynpro java application with 20 screens /views. And we are connecting to the SAP as a backend through RFC model.

We want to maintain the screen level visibility,like if user is having administrator role he can have access to all the screens.And if the user is having a supervisor role he can access to only limited screens.

How can i handle this scenario ? Can i use UME project for this purpose ? Or any other way to acheive this case ?

Please suggest the solution.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can get the user details who is logged in and roles of the user in your web dynpro application

Based on the roles of the user you can make some views or some UI's invisible

Regards,

Amol

former_member214651
Active Contributor
0 Kudos

Hi,*

To get the role of the user logged in, refer to the thread below:

For visibility setting use the WDVisibility property.

1. Create an attribute in the context UIVisibility

2. Set the type as "Visibility" which is found in the com.sap.uielementdefinitions

3. Bind the "visible" property of the UI element to the context attribute created in step1

4. in the wdDoInit(), write the following code:

if(("Admin").equalsIgnoreCase(role))
{
    //Based on the requirement
    wdContext.currentContextElement().setUIVisibility(WDVisibility.NONE);
                                       or
    wdContext.currentContextElement().setUIVisibility(WDVisibility.VISIBLE);
}

former_member225041
Participant
0 Kudos

Hi Poojith,

Thanks for the reply. But I am not going to handle visiblity at UI element's level. We have to make at Screen level. Depending upon the role we have to display screen to the user.

One more doubt is we are not going to use Portal for integration,So in this case is it possible to use UME library ? Or else what would be an approriate solution ?

Thanks again !!

former_member185879
Active Contributor
0 Kudos

Hello,

Can you explain bit more about the Screen Level?

as per my understanding, you are saying that all 20 views should be displayed to admin role and only 10 view should be displayed other role.

for this what you can do is...you can have the bind the viewcontainer and bind the required views to that, so that according to the role you can hide that particular view container itself.

Regards

Nizamudeen SM