2009 May 27 9:25 PM
Hi all,
I am working on an issue ... where I have to restrict a user to execute a set of code based on his role, so basically what I need to look out for the role of user from table agr_users... and if the user falls in a particular role ..let's say ztest_role then he shouldn't have the right to execute the code and should exit out but otherwise he should be able to do that.
Can you please help me with this.
Thanks,
Rajeev
2009 May 27 9:53 PM
Hello Rajeev
Normally you would check the authorization for an AUTH object contained within this z-role.
However, if you want to particularly check for a role assignment you could use
BAPI_USER_GET_DETAILto read the role assignment.
In order to implement this in a more general way you may create a function module or class containing a method where the interface looks like this:
ID_ROLE (IMPORTING parameter)
RD_SUBRC (RETURNING parameter) or raise an exceptionWithin the fm or method you call the BAPI and check for the required role assigment.
Regards
Uwe
Hello Rajeev
Normally you would check the authorization for an AUTH object contained within this z-role.
However, if you want to particularly check for a role assignment you could use
BAPI_USER_GET_DETAILto read the role assignment.
In order to implement this in a more general way you may create a function module or class containing a method where the interface looks like this:
ID_ROLE (IMPORTING parameter)
RD_SUBRC (RETURNING parameter) or raise an exceptionWithin the fm or method you call the BAPI and check for the required role assigment.
Regards
Uwe
2009 May 27 9:53 PM
Hello Rajeev
Normally you would check the authorization for an AUTH object contained within this z-role.
However, if you want to particularly check for a role assignment you could use
BAPI_USER_GET_DETAILto read the role assignment.
In order to implement this in a more general way you may create a function module or class containing a method where the interface looks like this:
ID_ROLE (IMPORTING parameter)
RD_SUBRC (RETURNING parameter) or raise an exceptionWithin the fm or method you call the BAPI and check for the required role assigment.
Regards
Uwe
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |