cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization checks in WDA View

Former Member
0 Kudos

Hi All,

I have a single WDA Compnent having one View. This View has some buttons that only certain users should be allowed to access. So I need to carry out authorization checks in Backend. Can someone please give me an example of how to proceed on such a scenario? Appreciate your help.

Thks in advance, Liz

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You can create authorization objects in SU21, if there are already standard authorization exiss you can skip this

use AUTHORITY-CHECK statement to know the authorization of the user

based on the result enable or disable the button's properties.

Thanks

Abhi

Former Member
0 Kudos

Hi Liz..

1) Create a field Zatt " tcode:su20"and assign DATa Element (Type : WDYBOOLEAN).

2) Create an ObjetClasse Zclass "tcode: su21"

3) In this objectclass you create an authorization Object. Z2 that contain ACTVT and the Field Zatt .

4) Now you can create one role "tcode : pfcg" with one authorization Z2 -> assign tha ACTVT : 03 and the Zatt to false.

5) Assign this role to the user that "tcode: SU01".

Finally in the WDY componant, you create a node with an attribute : Visibility type WDYBOOLEAN.

you bind the attribute VISIBLE of boutons that you like to Hide .

Finally -> In the method WDDOINIT of the main Insert this code :

Authority-check Object 'ROLE_NAME'

    ID 'ACTVT' Field '03'
    ID 'Zatt' FIELD Visibility.

  IF sy-subrc EQ 0.

      Visibility = 'X'.
      lo_el_NADE_NAME->set_attribute(
      name =  `NODE_NAME`
      value = Visibility ).
  ENDIF. 

Hope It's Help

Best Regards

Edited by: Jcrios on Jun 4, 2010 4:21 PM

Former Member
0 Kudos

Hi Abhi and Jcrios,

Thanks for your replies. I am generally working on the Webdynpro dev part. Would you advise if the tasks you have mentioned are more of a Security team's task? I havent worked with the transactions that you have mentioned and it looks to me like I should get some help from Security and do the Webdynpro code as you have suggested.

Thks! Liz

alejiandro_sensejl
Active Participant
0 Kudos

Hi Liz,

that depends on your customer / company!

Normally all you do as a developer is to implement the specified authority checks and do some appropriate message / transaction handling, but I've also worked for some customers (mostly in smaller projects) that asked me to create the authorization objects & roles by myself and assign them to specified users.

You should ask the person responsible for your project whose job this is.

Regards,

Alej

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Create a context node with an attribute say 'X' of type WDUI_VISIBILITY. bind the property 'visible' of your buttons with this attribute. Now in the WDINIT method of your component controller, set the visibility as per your need.

Example : if user is a manager ( u can get user details from sy-uname)

set the value of the attribute as '02' ---> button will be visible

else.

set the value of the attribute as '01' ---> button will not be visible

endif.

Thanks

Vishal

Former Member
0 Kudos

Hi,

why don't you think of creating 2 different component configurations for 2 differet roles( with desired buttons hidden in each of respective configurations ).

Then you can pass the URL with respective WD configurations to desired users.

Regards

Manas Dua