cancel
Showing results for 
Search instead for 
Did you mean: 

role based aunthentication

Former Member
0 Kudos

hi all,

Can anyone give me an idea on how to implement role based authentication in WDABAP?if possible with an example

Thanks in advance,

Regards,

Anusha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have to do it manually in the code by using CHECK AUTHORITY OBJECT.

If you want to check the authority for the first time when the application will run...do the coding within WDDOINIT of the Componentcontroller...

reward point if it is useful.

Former Member
0 Kudos

hi

Thanks for ur response.what is check-authority object i have no idea on this.can anyone give me more detailed explanation of it?to which class this check authority object belongs to and from where can we get the roles and users list

Regards,

Anusha

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

You have to perform the following Steps:

1. Create Object Class and Authority Object

2. Create Role

3. Assign the Authority Object to the Role and Generate

4. Assign Role to User

5. Use AUTHORITY-CHECK statement in your web application

1.Goto Transaction SU21

Create Object Class from the Toolbar available ( Ex: ZWEB)

Under the Object Class Create Authority Object ( Ex : ZWEBAPP )

2.Create a Role Using Transaction PFCG

Enter the Role Name ( Ex: ZROLE )and choose Create button

Choose Authorizations tab

Click Change Authorization data

Click Manually button in the Toolbar

3.give the Authority Object (Ex: ZWEBAPP ) you created.

Save and Generate ( Shift+ F5 )

4.To Assign the Role to a user goto Transaction SU01

Enter User Name and click edit

Move to Roles Tab

add the Role( Ex: ZROLE ) you have just Created in transaction PFCG

You have created Authority Object, Role

Assigned the Authority Object to the Role and

Assigned the Role to the User.

5.Now, In your Web Dynpro Application in WDDOINIT

you have to check whether the user has this Authority to execute this Application.

To check this use the statement

AUTHORITY-CHECK OBJECT 'ZWEBAPP' .

if sy-subrc = 0.

< Continue >

else.

<Navigate to some other Page >

endif.

Now, goto SU01 and enter the usernames and add the Role, to whom you want to give the access to the web application

Abhi

Edited by: Abhimanyu Lagishetti on Jun 11, 2008 12:10 PM

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The current posters are correct, in WDA we continue to use the ABAP Authorization Check concept. Nothing new there for WDA. Here is a link to some online help that explains the process in greater detail:

[http://help.sap.com/saphelp_nw70/helpdata/EN/52/67167f439b11d1896f0000e8322d00/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/52/67167f439b11d1896f0000e8322d00/frameset.htm]

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

You have to implement this manually through coding.

using CHECK AUTHORITY statement.

OR use Enterprise Portal to control the role based access.

Abhi

Former Member
0 Kudos

hi abhimanyu,

can u explain me little bit more?

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

In General Role Based Authorization is controlled in Enterprise Portal.

In your Organization if you don't have Enterprise Portal, you could control the Authorization using

Authority Objects.

In WDDOINIT of the first view use the command

AUTHORITY-CHECK OBJECT <Authority obj. you created for the WDA>

if sy-subrc = 0.

< continue with the application >

else.

< navigate to some error view >

Abhi