cancel
Showing results for 
Search instead for 
Did you mean: 

Display default view based on the authorization

Former Member
0 Kudos

Hi,

My requirement is only few users will have authorization to WD ABAP application.

If user do not have authorization then only message will be displayed, no view contents will be displayed.

I my application, there are 2 views in a window.

So I am checking the authorization in inbound plug of main window and accordingly message is displayed but

eventhen first view is being displayed.

How to resolve the issue.

Thanks, in advance

Trupti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Trupti

Here are few options for you

1) Using a dummy view :

a) Create a dummy view, make it as a default view
     b) Check the authorization in WDDOINIT method of Component Controller
     c) If user is not authorized then,you can use the dummy view to display error message  "You are not authorized to
         access this Application"
     b) create 2 Out bound plugs for 2 views from dummy view, if user is authorized then navigate accordingly

2) To handle without creating a dummy view

a) Create an attribute of type WDY_BOOLEAN in component controller named "UI_VISIBLE" 
   b) Check the authorization in WDDOINIT method of Component Controller
        i) If user is authorized set "UI_VISIBLE" with value "ABAP_TRUE"
        ii) If user is NOT authorized set "UI_VISIBLE" with value "ABAP_FALSE"
  c) Map the UI_VISIBLE to your default view and bind UI_VISIBLE to visible property of ROOTUIELEMENTCONTAINER
  d) Generate REPORT_ERROR_MESSAGE in the WDDOINIT method of the default view to show the error message
      (Even if you hide the ROOTUIELEMENTCONTAINER, still you can show the error message)
  e) If you want to navigate to second view then based on the authorization use out bound plug to navigate in the
      WDDOINIT method of the default view

This post is extension of Chris reply

Thanks and Regards

Chaitanya.A

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hi,

the simplest solution would be to have the visibility of the root elements of those views bound to a context element, which you could then set during your authorisation check.

have auth - set visibility to visible - do not have auth - set visibility to none...

Alternate solutions - only embed your views into the window once you know whether the user has passed the auth check, embed a different dummy view if they fail. (advantage to this - the various calls to populate the views will not be made if you never present them.)

Hope that helps,

Chris