Skip to content

Commit fa4c732

Browse files
authored
actual separation of concern (#2285)
The section `separation of concerns` on the authorization page currently does not show any separation => use actual separation of concerns. <img width="732" height="872" alt="Screenshot 2025-12-16 at 14 03 45" src="https://github.com/user-attachments/assets/5e944390-3b9a-4a35-bd48-c64274e22ae3" />
1 parent 72d959f commit fa4c732

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

guides/security/authorization.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -830,19 +830,16 @@ service CustomerService {
830830
<!--- % include _code sample='services-auth.cds' %} -->
831831
::: code-group
832832
```cds [services-auth.cds]
833-
service ReviewsService @(requires: 'authenticated-user'){
834-
/*...*/
835-
}
836-
837-
service CustomerService @(requires: 'authenticated-user'){
838-
entity Orders @(restrict: [
839-
{ grant: ['READ','WRITE'], to: 'admin' },
840-
{ grant: 'READ', where: 'buyer = $user' },
841-
]){/*...*/}
842-
entity Approval @(restrict: [
843-
{ grant: 'WRITE', where: '$user.level > 2' }
844-
]){/*...*/}
845-
}
833+
annotate ReviewsService with @(requires: 'authenticated-user');
834+
835+
annotate CustomerService with @(requires: 'authenticated-user');
836+
annotate CustomerService.Orders with @(restrict: [
837+
{ grant: ['READ','WRITE'], to: 'admin' },
838+
{ grant: 'READ', where: 'buyer = $user' },
839+
]);
840+
annotate CustomerService.Approval with @(restrict: [
841+
{ grant: 'WRITE', where: '$user.level > 2' }
842+
]);
846843
```
847844
:::
848845

0 commit comments

Comments
 (0)