on 06-03-2010 9:45 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.