-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-profile-service.cds
35 lines (28 loc) · 1.01 KB
/
my-profile-service.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using { com.sample as schema } from '../db/schema';
///////////////////////////////////////////////////////////////////////
// Service to manage employee's own profile and assign/unassign skills
//
@path: 'my-profile'
service MyProfileService @(requires: 'authenticated-user') {
@readonly entity Teams as projection on schema.Teams;
@cds.redirection.target
@Capabilities.Insertable: false
@Capabilities.Deletable: false
entity Employee @(restrict: [
{ grant: ['READ','UPDATE']}
]) as projection on schema.Employees excluding {
createdAt,
createdBy
};
@Capabilities.Insertable: false
@Capabilities.Deletable: false
@odata.singleton
entity Profile @(restrict: [
{ grant: ['READ','UPDATE']}
]) as projection on schema.Employees;
entity Skills as projection on schema.Skills;
}
// Deep Search Items
annotate MyProfileService.Skills with @cds.search : { name };
// Enable Fiori Draft
annotate MyProfileService.Employee with @odata.draft.enabled;