on 05-13-2008 2:34 PM
hi sap-gurus
how can I get the portal roles which are connected with an abap sap user.
for example an abap user starts a wd application in the portal and I want to find out if he is in the administrator role for this web dynpro application and has enhanced rights for the application?
has anyone an idea how I can read out these informations in my wd application?
thanks
In general, you wouldn't necessarily go after the portal roles for that information. You would use the local role information, by performing authorization checks in ABAP coding. The local role information is likely the basis of the portal roles, however there really isn't an API or Service (yet) to allow for the easy consumption of the portal roles.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you thomas for your answer...
ok you are right...the local roles from the abap user might be the solution but how can I read out the roles from the abap user?
is there a bapi or can I read some system tables to get these local roles which can be seen in ta su01?
what do you mean with "authorization checks"...can you give me a sample coding?
regards
In ABAP you don't generally read roles directly. Instead there is a concept called an authorization check. This is old school ABAP stuff, but it still holds true in Web Dynpro ABAP. You can lookup the term authority-check in the ABAP keyword documentation for more details. Here is a quick example. This is the authorization check to access Carriers - broken down by the Carrier ID and the Activity Display (03):
PARAMETERS carr TYPE spfli-carrid.
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD carr
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
MESSAGE 'No authorization' TYPE 'E'.
ENDIF.
Usually you limit the access to object via different activity types.
There are also several sections of the online help on the topic:
ht[http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm]
thank you again....I found another post here..
I think I have to make the following steps to make an authority-check (step 2) in my wda coding:
1. Create an authorisation object (SU21)
2. Put an authorisation check for this object in your report (AUTHORITY-CHECK)
3. Create a role that contains this object (PFCG)
4. Assign this role to all the users who require access to the report (SU01).
is it the right way?
Hi Thorsten!
Came across your post and I seem to have a similar requirement. I need to read Portal roles for a user in a ABAP report.
Is there a way to do so. I mean a BAPI or FM that gets the portal roles for a specified user?
Any help in this regard is inviting.
Thanks,
Trishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.