cancel
Showing results for 
Search instead for 
Did you mean: 

Assign Role in S4 HANA Public Cloud

JoelleS
Explorer
0 Kudos
331

Hi everyone,

I use Eclipse (ABAP ADT) to create a custom CDS view: 

@AbapCatalog.viewEnhancementCategory: [#NONE]

//@AccessControl.authorizationCheck: #NOT_REQUIRED

//@AccessControl.authorizationCheck: #CHECK

 

@AccessControl: {

authorizationCheck: #CHECK }

 

@EndUserText.label: 'ZJSTR_TEST1'

@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.usageType:{

serviceQuality: #X,

sizeCategory: #S,

dataClass: #MIXED

}

define view entity ZJSTR_TEST1

 

as select from I_Product

association [0..1] to I_ProductText as _Text on $projection.Product = _Text.Product

and _Text.Language = $session.system_language

/*association [0..*] to I_ProductPlantBasic as _ProductPlantBasic on $projection.Product = _ProductPlantBasic.Product*/

association [0..*] to I_MaterialStock_2 as MaterialStock on $projection.Product = MaterialStock.Material

association [0..*] to I_EWM_AvailableStock as EWMAvailableStock on $projection.ProductUUID = EWMAvailableStock.ProductUUID

//association [0..*] to I_SlsPrcgCndnRecdValidity as PrcRecValidities on $projection.Product = PrcRecValidities.Material

//I_SLSPRCGCONDITIONRECORD

 

{

key Product,

MaterialStock,

_Text.ProductName,

ProductType,

EWMAvailableStock,

ProductUUID,

EWMAvailableStock.EWMWarehouse

 

}

 

I defined a role as Access Control

@EndUserText.label: 'ZJSTR_TEST1 AC'

@MappingRole: true

//role ZJSTR_TEST1 {

role ZJSTR_TEST1 {

grant SELECT on ZJSTR_TEST1;

 

}

 

 

How do I assign this role to a user?

 

 

View Entire Topic
junwu
Active Contributor
0 Kudos

cds role is applicable/assigned to all user automatically, no need to assign

JoelleS
Explorer
0 Kudos
Hi Junwu, thank you for your reply. The data can't be displayed bc of missing access. So it seems, like this is not working in S4HANA Public Cloud or am I mistaken?
JoelleS
Explorer
0 Kudos
For custom CDS Views, created on S4 Public Cloud interface, I am able to see the data.
JoelleS
Explorer
0 Kudos
for everyone wondering, you have to active "Key User Apps" in Contract C1