ABAP Keyword Documentation → ABAP Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Authorizations → ABAP CDS - DCL Statements
This functionality is not yet released and must not be used
ABAP CDS - DEFINE ACCESSPOLICY
Other versions:
7.31 | 7.40 | 7.54
Syntax
[DEFINE] ACCESSPOLICY access_policy_name {
[aspect_annot11]
[aspect_annot12]
...
aspect_definition1
[[aspect_annot21]
[aspect_annot22]
...
aspect_definition2]
... }
Effect
Defines an access policy access_policy_name used as a framework for the definition of aspects with the statement DEFINE ASPECT and its annotations in CDS source code.
The only dependencies between the aspects in an access policy are the fact that they are in the same policy and are located in its source code. The aspects in an aspect policy can be used globally in the definition of an assignment role with DEFINE ROLE.
Notes
- Separate CDS source code must be created for each access policy. The CDS source code of an access policy is edited in a different editor from the CDS source code of a CDS view. The ADT documentation describes how the different types of source code are created.
- Aspects and access policies are not currently implemented, since there is no tool available for assigning assignment roles.
Example
The access policy for_sales_orders bundles aspects that can be used for CDS roles for sales orders.
ACCESSPOLICY for_sales_orders {
@EndUserText.label: 'Employee Country'
ASPECT acmtst_employee_country as
SELECT FROM sacm_cds_snwd_ad { country }
WHERE $User IN toemployee.login_name;
@EndUserText.label: 'Employee Orgunit'
ASPECT acmtst_employee_orgunit as
SELECT FROM sacm_cds_snwd_depts { org_unit_name }
WHERE $User IN tostaffing.toemployee.login_name; }