0% found this document useful (0 votes)
145 views2 pages

Implementing DCL With CDS Views and Roles-CODE

This document defines two views (ZDCL_I_CO and ZDCL_C_CO) and an access control role (ZDCL_C_CO). The views select data from a source table and define fields. The access control role grants select access to the consumption view ZDCL_C_CO based on a field match against an authorization object.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views2 pages

Implementing DCL With CDS Views and Roles-CODE

This document defines two views (ZDCL_I_CO and ZDCL_C_CO) and an access control role (ZDCL_C_CO). The views select data from a source table and define fields. The access control role grants select access to the consumption view ZDCL_C_CO based on a field match against an authorization object.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

@AbapCatalog.

sqlViewName: 'ZAR_I_DCL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'DCL Implementation Test'
define view ZDCL_I_CO as select from zarj_dcl_test {
key pid as CityUUID,
key1 as KeyCounCode,
value as CityCode,
name as CityName
}

@AbapCatalog.sqlViewName: 'ZAR_C_DCL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Consumption DCL'
@VDM.viewType: #CONSUMPTION
@OData.publish: true
@Search.searchable: true
define view ZDCL_C_CO as select from ZDCL_I_CO {
key CityUUID as CityUUID,
@Search.defaultSearchElement: true
@UI.identification: [{position: 10}]
@UI.selectionField: {position: 10}
@UI.lineItem: { position: 10}
@EndUserText.label: 'Country Code'
KeyCounCode as KeyCounCode,
@Consumption.filter: {selectionType: #SINGLE, multipleSelections: false}
@UI.selectionField: {position: 20}
@UI.identification: [{position: 20}]
@UI.lineItem: { position: 20}
@EndUserText.label: 'City Code'
CityCode as CityCode,
@UI.lineItem: { position: 30}
@EndUserText.label: 'City Name'
CityName as CityName
}

@EndUserText.label: 'Access Control for ZDCL_C_CO CDS View'


@MappingRole: true
define role ZDCL_C_CO {
grant
select
on
ZDCL_C_CO
where ( KeyCounCode ) = aspect pfcg_auth( ZCOUNCDE,
ZAR_DLC_CC );
//syntax: where ( CDS_FIELD_NAME ) = aspect pfcg_auth (
Authorization_Object, Auth_field )
}

You might also like