cancel
Showing results for 
Search instead for 
Did you mean: 

DCL - Grant select on - what happens if?

Arul77
Discoverer
0 Kudos
188

Hi Gurus,

I have a custom CDS view ZEntity1 for which I defined a role with the same name as CDS view - ZEntity1 using DCL. According to the books the 'Grant select' should be on the CDS view, however in my DCL code of ZEntity1 the Grant Select is on another standard view "I_SalesDocumentItem".

Can some please explain if the DCL will control the view ZEntity1 or I_SalesDocumentItem? Is there any use in doing this way?

Code Snippet:
@EndUserText.label: 'DCL for ZENTITY1'
@MappingRole: true
define role ZENTITY1{
grant select on I_SalesDocumentItem
where ( _SalesDocument.SalesDocumentType ) =
aspect pfcg_auth ( v_vbak_aat,
auart,
actvt = '03' )

View Entire Topic
umasaral
Participant
0 Kudos

Hi Arul,

 

If you specify a GRANT SELECT on I_SalesDocumentItem in the DCL for ZEntity1, then the role will control access to I_SalesDocumentItem, not ZEntity1.

 

if your intent is to control access to ZEntity1, the GRANT SELECT should be on ZEntity1 in your DCL code. Using I_SalesDocumentItem will control access to I_SalesDocumentItem, which is not what you want if you aim to control access to ZEntity1.

Arul77
Discoverer
0 Kudos
Thank you Umasaral