Showing posts with label Authorizations in BIW. Show all posts
Showing posts with label Authorizations in BIW. Show all posts

Friday, September 12, 2008

Assigning Authorizations Netweaver

Use

A single administrator (superuser) or a group of administrators assign authorizations, depending on the size and organization of your company. By assigning authorizations, the administrator determines (within the range of possibilities defined by the programmer) which functions a user may execute or which objects he or she may access.

Process Flow

As an administrator, you perform the following steps to assign authorizations:

· Maintaining authorizations for each authorization object

An authorization is the combination of permissible values in each authorization field of an authorization object.

· Generating Authorization Profiles

Authorizations are grouped in authorization profiles in such a way that the profiles describe work centers, for example, flight reservation clerk.

We recommend that your system administrator automatically sets up authorization profiles using the Profile Generator (see Role Maintenance). If necessary, the administrator can also set up an authorization profile manually by choosing Tools ®Administration, User maintenance ® Profiles (see Creating and Maintaining Authorizations and Profiles Manually).

· Assigning authorization profiles to a user master record

By assigning the roles, you assign the corresponding authorization profiles (work centers) to a user master record.

Result

When an authorization check takes place, the system compares the values entered by the administrator in the authorization profile with those required by the program for the user to execute a certain activity.

Authorization Netweaver

Authority to execute a particular action in the SAP system. Each authorization references an authorization object. It defines one or more values for each authorization field contained in the authorization object. Authorizations are combined in profiles, which are entered in a user’s master record.

The user can work in the SAP System after a successful authorization check.

Editing Predefined Authorizations Netweaver

Once you have a role, you can generate authorizations automatically. The values of these authorizations are predominantly supplied with SAP default values. However, you can add missing values, change default values and also add additional authorizations from SAP templates or profiles.

Generating Authorizations

...

1. In role maintenance (transaction PFCG), choose the Authorizations tab page.

In addition to creation and change information, there is also information about the authorization profile there: the profile name, profile text, and status.

The status display on the Authorizations tab page displays whether or not the corresponding authorization profile is current. The profile is not current if the display is red or yellow. In this case, the status text on the tab page shows the reason for this.

2. To change the predefined and open authorizations of the transactions assigned to the role, choose Change Authorization Data or Expert Mode for Profile Generation.

You can explicitly select the maintenance options for the authorization values in export mode. This option is automatically set correctly in normal mode.

3. Maintain the predefined and open authorization fields for the transactions.

4. To generate an authorization profile based on this data with the Profile Generator, choose Generate (This graphic is explained in the accompanying text ).

The authorization profile generated in this way is added to the master records of the users of the role after the user master records are compared.

Changing authorizations

...

1. Choose Change Authorization Data.

2. You can maintain organizational levels by choosing Org. levels.

Note

If the selected authorization data contains organizational levels, the dialog window appears.

Organization levels can be plants, company codes and business areas, for example. Specify a global value for this role for each organizational level; that is, for each field.

Note

You can display and maintain existing organizational levels with the transaction SUPO.

3. Save your entries.

4. Check or change the default authorizations in the hierarchy view displayed. See SAP authorization concept and Authorization maintenance symbols and status texts.

Authorization Checks Netweaver

To ensure that a user has the appropriate authorizations when he or she performs an action, users are subject to authorization checks.

The following actions are subject to authorization checks that are performed before the start of a program or table maintenance and which the SAP applications cannot avoid:

· Starting SAP transactions (authorization object S_TCODE)

· Starting reports (authorization object S_PROGRAM)

· Calling RFC function modules (authorization object S_RFC)

· Table maintenance with generic tools (S_TABU_DIS)

Checking at Program Level with AUTHORITY-CHECK

Applications use the ABAP statement AUTHORITY-CHECK, which is inserted in the source code of the program, to check whether users have the appropriate authorization and whether these authorizations are suitably defined; that is, whether the user administrator has assigned the values required for the fields by the programmer. In this way, you can also protect transactions that are called indirectly by other programs.

AUTHORITY-CHECK searches profiles specified in the user master record to see whether the user has authorization for the authorization object specified in the AUTHORITY-CHECK. If one of the authorizations found matches the required values, the check is successful.

Starting SAP Transactions

When a user starts a transaction, the system performs the following checks:

· The system checks in table TSTC whether the transaction code is valid and whether the system administrator has locked the transaction.

· The system then checks whether the user has authorization to start the transaction.

The SAP system performs the authorization checks every time a user starts a transaction from the menu or by entering a command. Indirectly called transactions are not included in this authorization check. For more complex transactions, which call other transactions, there are additional authorization checks.

¡ The authorization object S_TCODE (transaction start) contains the field TCD (transaction code). The user must have an authorization with a value for the selected transaction code.

¡ If an additional authorization is entered using transaction SE93 for the transaction to be started, the user also requires the suitable defined authorization object (TSTA, table TSTCA).

Note

If you create a transaction in transaction SE93, you can assign an additional authorization to this transaction. This is useful, if you want to be able to protect a transaction with a separate authorization. If this is not the case, you should consider using other methods to protect the transaction (such as AUTHORITY-CHECK at program level).

· The system checks whether the transaction code is assigned an authorization object. If so, a check is made that the user has authorization for this authorization object.

The check is not performed in the following cases:

You have deactivated the check of the authorization objects for the transaction (with transaction SU24) using check indicators, that is, you have removed an authorization object entered using transaction SE93. You cannot deactivate the check for objects from the SAP NetWeaver and HR areas.

This can be useful, as a large number of authorization objects are often checked when transactions are executed, since the transaction calls other work areas in the background. In order for these checks to be executed successfully, the user in question must have the appropriate authorizations. This results in some users having more authorization than they strictly need. It also leads to an increased maintenance workload. You can therefore deactivate authorization checks of this type in a targeted manner using transaction SU24.

¡ You have globally deactivated authorization objects for all transactions with transaction SU24 or transaction SU25.

¡ So that the entries that you have made with transactions SU24 and SU25 become effective, you must set the profile parameter AUTH/NO_CHECK_IN_SOME_CASES to “Y” (using transaction RZ10).

All of the above checks must be successful so that the user can start the transaction. Otherwise, the transaction is not called and the system displays an appropriate message.

Starting Report Classes

You can perform additional authorization checks by assigning reports to authorization classes (using report RSCSAUTH). You can, for example, assign all PA* reports to an authorization class for PA (such as PAxxx). If a user wants to start a PA report, he or she requires the appropriate authorization to execute reports in this class.

We do not deliver any predefined report classes. You must decide yourself which reports you want to protect in this way. You can also enter the authorization classes for reports with the maintenance functions for report trees. This method provides a hierarchical approach for assigning authorizations for reports. You can, for example, assign an authorization class to a report node, meaning that all reports at this node automatically belong to this class. This means that you have a more transparent overview of the authorization classes to which the various reports are transported.

Note

You must consider the following:

· After you have assigned reports to authorization classes or have changed assignments, you may have to adjust objects in your authorization concept (such as roles (activity groups), profiles, or user master records).

· There are certain system reports that you cannot assign to any authorization class. These include:

· RSRZLLG0

· STARTMEN (as of SAP R/3 4.0)

· Reports that are called using SUBMIT in a customer exit at logon (such as SUSR0001, ZXUSRU01).

· Authorization assignments for reports are overwritten during an upgrade. After an upgrade, you must therefore restore your customer-specific report authorizations.

Calling RFC Function Modules

When RFC function modules are called by an RFC client program or another system, an authorization check is performed for the authorization object S_RFC in the called system. This check uses the name of the function group to which the function module belongs. You can deactivate this check with parameter auth/rfc_authority_check.

Checking Assignment of Authorization Groups to Tables

You can also assign authorization groups to tables to avoid users accessing tables using general access tools (such as transaction SE16). A user requires not only authorization to execute the tool, but must also have authorization to be permitted to access tables with the relevant group assignments. For this case, we deliver tables with predefined assignments to authorization groups. The assignments are defined in table TDDAT; the checked authorization object is S_TABU_DIS.

Example

You can assign a table to authorization group Z000. (Use transaction SM30 for table TDDAT) A user that wants to access this table must have authorization object S_TABU_DIS in his or her profile with the value Z000 in the field DICBERCLS (authorization group for ABAP Dictionary objects).

See also:

· SAP Notes 7642, 20534, 23342, 33154, and 67766

· Documentation for RSCSAUTH

Authorization Checks in Your Own Developments

Each time a transaction is started, the system automatically checks for authorization object S_TCODE. This check is also executed for any transactions that you created yourself.

If you use the Profile Generator to generate your authorization profiles automatically, the authorizations for the authorization object S_TCODE are contained in the profiles.

You can also add your own authorization checks to protect critical points in your ABAP programs.

Caution

If you call a transaction indirectly, that is from another transaction, the authorization check is not automatically performed. You must use transaction SE97 to set the check indicator check for the entry for the pair of calling and called transaction to ensure that the called transactions are also subject to an authorization check (see SAP Note 358122).

Adding Authorization Checks to Programs

In order to maintain authorization objects and fields, you need access to the authorization object Authorizations (S_USER_AUT).

To add authorization checks to programs, you need to do the following:

...

1. Create an Authorization Field
2. Create an Authorization Object
3. Programming Authorization Checks

Use the ABAP AUTHORITY-CHECK statement. Specify alphabetic values in uppercase letters: ABC. Test values from user master records are converted to uppercase before being passed to AUTHORITY-CHECK.

See the ABAP programming documentation for more information (Structure linkcheck authorization).

Programming Authorization Checks

programmer wants to make an authorization check before bookings for business customers can be changed.

To do this, the programmer should create authorization fields (ACTVT and CUSTTYPE) and assign for each field defined the value to be checked (02, B). Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Fields (transaction SU20).

Programmers should also create an authorization object (here S_TRVL_BKS) and assign the authorization object to an object class.

Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
ID 'ACTVT' FIELD '02'
ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.
MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

When this happens, the system checks the authorization profiles in the user’s master record for the appropriate authorization object (S_TRVL_BKS). If the authorization is found and it contains the correct values, the check is successful.

The system administrator has defined the following authorizations for the authorization object S_TRVL_BKS:

· S_TRVL_CUS1 with the following values:

* for customer type ( CUSTTYPE field) and

03 for activity (field: ACTVT).

Users with this authorization can display all customer bookings (activity 03 = display).

· S_TRVL_CUS2 with the following values:

B for customer type ( CUSTTYPE) and

02 for activity (ACTVT).

Users with this authorization can change all business customers (activity 02 = change).

When assigning profiles, the system administrator gave different authorizations to different users.

User Miller has been assigned a profile containing both of these authorizations (S_TRVL_CUS1 and S_TRVL_CUS2). Miller can therefore change bookings for business customers.

User Meyers on the other hand, is only authorized to display the records (S_TRVL_CUS1) and therefore cannot change bookings.

All Rights Reserved