How is authorization handled in RAP? Explain global versus instance authorization, master versus dependent, and precheck.
Say your answer out loud first.
Practise another way
I declare authorization master ( global, instance ) on the root. Global authorization checks a role, not a record, for example may this user create. Instance authorization checks the record, for example the user's sales organization.
Child nodes are authorization dependent by their parent. Reads are protected by CDS access control, not by the BDEF. Precheck is a separate hook that stops a change before it reaches the buffer.
Declaration
define behavior for ZR_Travel alias Travel
authorization master ( global, instance )
{
create; update; delete;
action ( authorization : none ) getPriceHint result [1] $self;
}
define behavior for ZR_Booking alias Booking
authorization dependent by _Travel
Global versus instance
- Global (
FOR GLOBAL AUTHORIZATION): independent of an instance. This is the only authorization that can apply to create, because no instance exists yet. Typically anAUTHORITY-CHECKon an authorization object with the activity. - Instance (
FOR INSTANCE AUTHORIZATION): depends on the record, for example the country of the agency. It runs right before the modification and sees only the state before the change, not incoming values. The handler gets the keys, reads the instance data and sets%update,%deleteand%action-...per key toif_abap_behv=>auth-allowedorauth-unauthorized.
You can combine both. Individual operations and actions can override the default: authorization : none, or authorization : global or instance on an action, or authorization : update to delegate a delete to the update check.
Master and dependent
The root is always authorization master. Child nodes are normally authorization dependent by the association to the parent, so one check covers the whole tree.
Read
The BDEF does not protect reads. Use CDS access control (DCL) for row-level read restrictions. Say this explicitly in the interview.
Precheck
create ( precheck ) or action ( precheck ) calls a FOR PRECHECK handler before the change enters the transactional buffer. It checks the incoming values against the before image, for example that an agency may only change travels of its own country.
It rejects with failed and reported, so invalid values never get into the buffer. It only sees input from outside consumers: IN LOCAL MODE skips it.
Trade-off
Precheck is for cheap checks on incoming data, for example for an unauthorized value. Business consistency stays in validations, because those also run on draft activation and on data created by your own code.
Knows that only global authorization applies to create, that reads belong to DCL, and that precheck blocks a change before it enters the buffer while validations run on save.
Puts everything in one method called 'authorization check' and does not distinguish global from instance or mention access control.
Writing authority checks inside a validation or only in the UI. The BDEF authorization handlers are what the framework enforces for every consumer, and read access still needs DCL.
- How do you stop a user from calling one action, but allow update?
- Why is instance authorization not possible on create?
- What does authorization : none do and when is it right?
- When would you use a precheck instead of a validation?
4 official pages. Confidence: medium. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.