What does it do? Defines a CDS role> called role_name> in the CDS DCL>. A CDS role consists of one or more access rules access_rules>> specified within the curly brackets. Each access rule defines access to a CDS> entity. A CDS role can contain access rules for different CDS entities. An access rule either defines an access condition> for the CDS entity or grants full access. When a CDS entity of this type is accessed using AB_SQL , an access condition is evaluated as an additional selection condition. Before the role is defined using DEFINE ROLE>, the annotation @MappingRole>> must be specified with the value true>. The annotation @MappingRole>> is used to assign the CDS role to every user regardless of the client. Further optional annotations role_annot1>>, role_annot2 >>, ... can also be specified.
Latest notes:
Every CDS role defined using DEFINE ROLE> is assigned to every user implicitly, which means that the associated access control is applied to every user. User-specific checks are applied using PFCG conditions> and user conditions>.
A CDS role can be defined for a CDS entity in every package and in every system and specifies that implicit access control applies.
Access control can be disabled for a CDS entity as follows:
Specify the annotation @AccessControl.authorizationCheck> with the value #NOT_ALLOWED > in the definition of the entity. In this case, the definition of a role for the CDS entity produces a syntax check warning in the DCL editor.
Use the addition $[WITH$] PRIVILEGED ACCESS >> in AB-SQL when the entity is accessed.