diff --git a/guides/security/authorization.md b/guides/security/authorization.md index 2c5edc71c..d1cb7578a 100644 --- a/guides/security/authorization.md +++ b/guides/security/authorization.md @@ -830,19 +830,16 @@ service CustomerService { ::: code-group ```cds [services-auth.cds] -service ReviewsService @(requires: 'authenticated-user'){ - /*...*/ -} - -service CustomerService @(requires: 'authenticated-user'){ - entity Orders @(restrict: [ - { grant: ['READ','WRITE'], to: 'admin' }, - { grant: 'READ', where: 'buyer = $user' }, - ]){/*...*/} - entity Approval @(restrict: [ - { grant: 'WRITE', where: '$user.level > 2' } - ]){/*...*/} -} +annotate ReviewsService with @(requires: 'authenticated-user'); + +annotate CustomerService with @(requires: 'authenticated-user'); +annotate CustomerService.Orders with @(restrict: [ + { grant: ['READ','WRITE'], to: 'admin' }, + { grant: 'READ', where: 'buyer = $user' }, +]); +annotate CustomerService.Approval with @(restrict: [ + { grant: 'WRITE', where: '$user.level > 2' } +]); ``` :::