In this lesson, you will learn about the authorization concept for the On-Premise/Private cloud. With this knowledge, you will learn how to implement ABAP roles.
As you explored the roles, authorization profiles, and user master records in the previous lesson, you will now discover the ABAP authorization concept. In SAP's authorization framework, authorization object classes, objects, and fields all play crucial roles, but they operate at different levels of hierarchies and specificity. Here's a detailed breakdown.
For example, the authorization object S_USR_GRP relates to the user group in master record maintenance.
The important terminologies in the authorization concepts are as follows:
- Authorization Object Class: This high-level category groups related authorization objects for better organization and easier management.
- Authorization Object: An authorization object is a specific, predefined set of authorization fields that define a particular combination of conditions required for access control.
- Authorization Field: The Authorization Object is subdivided into groups of fields. These individual fields specify the detailed conditions for access.
Authorization objects protect actions and access to data in an ABAP-based SAP system. SAP delivers the authorization objects in SAP systems.
Putting It All Together
Example Scenario:
Suppose, a role needs to be created to allow certain admins to maintain user records within a specific user group "SUPER". Below are the components in restricting the roles authorizations
- Authorization Object Class: BC_A (Basis-Administration)
- Authorization Object: S_USER_GRP (User Master Maintenance: User Groups)
- Authorization Fields:
- CLASS (User Group in User Master Maintenance): SUPER (The specific User Group to allow access)
- ACTVT (Activity): 01 (Create), 02 (Change), 03 (Display
The purpose of the authorization object class is to organize the management of numerous authorization objects by grouping them into logical categories. For example, an authorization object class could relate to sales and distribution, finance, human resources, or any other functional area within the SAP system. This grouping helps make the security and authorization structure more understandable and easier to maintain.
Authorization objects are divided into various authorization object classes to provide a better overview of the impacted functions and components within the system. An authorization object class is a way to group logically related authorization objects. These classes help simplify and organize the management of authorizations in the SAP system by categorizing them based on their functionality or application areas.
Authorization objects encapsulate a set of authorization fields defining specific access rights. These fields hold values that determine a user's level of access to certain SAP functionality or data.
An authorization field is always associated with precisely one authorization object. Authorization is permission to perform a specific action in the SAP system.
The action is defined based on the values for the individual fields of an authorization object. For example, Authorization B in the figure for the authorization object S_USER_GRP allows the display of all user master records that are not assigned to the user group SUPER. Authorization A, however, enables the maintenance and display of records for this user group.
Multiple authorizations can be created for one authorization object. SAP delivers most authorizations with SAP default values, which can be amended to meet customer requirements. Also, authorizations can be designed specifically for custom application requirements.
Authorization Check
When a user logs on to an SAP system client, their authorizations are loaded in the user context. The user context is in the application server's user buffer (query using transaction SU56) in the main memory.
When the user calls a transaction, the system checks whether the user has authorization in the user context that allows them to call the selected transaction. Authorization checks use the authorizations in the user context.
If you, as an administrator, assign new authorizations to the user, the user must log on to the SAP system again to use them. (For more information, see SAP Note 452904 and the parameter auth/new_buffering documentation: https://me.sap.com/notes/452904).
If the authorization check for calling a transaction was successful, the system displays the initial screen of the transaction. Depending on the transaction, the user can create data or select actions.
ABAP developers build authority checks (AUTHORITY-CHECK) into the program code to protect the data and actions, which are checked during runtime in the work process. The "AUTHORITY-CHECK" command in SAP ABAP is used to verify whether a user has the necessary authorization for performing a specific action, such as running a transaction, updating a table, or accessing specific data. It checks the user's authorizations against specified authorization objects and their fields.
If the user context contains all required authorizations for the checks (return code = 0), the data and actions are processed, and the user can move to the next screen.
Even if just one authorization is missing, the data and actions are not processed, and the user receives a message that their authorizations are insufficient. The value of the return code controls this step. In this case, the value of the return code is not equal to 0.
SAP uses a positive authorization concept for these systems: all authorizations are permissions. There are no authorizations for prohibiting. Everything that is not explicitly allowed is forbidden.