Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions guides/security/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,19 +830,16 @@ service CustomerService {
<!--- % include _code sample='services-auth.cds' %} -->
::: 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' }
]);
```
:::

Expand Down