Skip to content

Commit

Permalink
editing
Browse files Browse the repository at this point in the history
  • Loading branch information
renejeglinsky committed Jun 14, 2024
1 parent faf4672 commit 387364d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
30 changes: 21 additions & 9 deletions guides/data-privacy/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ All found entities are classified as either *Data Subjects*, *Subject Details* o

Following the [best practice of separation of concerns](../domain-modeling#separation-of-concerns), we annotate our domain model in a separate file *srv/data-privacy.cds*, which we add to our project and fill it with the following content:

> For the time beeing also replace the data in _data/sap.capire.incidents-Customers.csv_.
::: code-group

```cds [db/data-privacy.cds]
using { sap.capire.incidents as my } from '../db/schema';
extend my.Customers with {
dateOfBirth : Date;
};
annotate my.Customers with @PersonalData : {
DataSubjectRole : 'Customer',
EntitySemantics : 'DataSubject'
Expand Down Expand Up @@ -65,6 +71,12 @@ annotate my.Incidents with @PersonalData : {
};
```

```csv [data/sap.capire.incidents-Customers.csv]
ID,firstName,lastName,email,phone,dateOfBirth
1004155,Daniel,Watts,daniel.watts@demo.com,+44-555-123,1996-01-01
1004161,Stormy,Weathers,stormy.weathers@demo.com,,1981-01-01
1004100,Sunny,Sunshine,sunny.sunshine@demo.com,+01-555-789,1965-01-01
```
:::


Expand Down Expand Up @@ -96,15 +108,15 @@ Annotation | Description
Hence, we annotate our model as follows:

```cds
annotate db.Customers with @PersonalData: {
annotate my.Customers with @PersonalData: {
EntitySemantics: 'DataSubject' // [!code focus]
};
annotate db.Addresses with @PersonalData: {
annotate my.Addresses with @PersonalData: {
EntitySemantics: 'DataSubjectDetails' // [!code focus]
};
annotate db.Incidents with @PersonalData: {
annotate my.Incidents with @PersonalData: {
EntitySemantics: 'Other' // [!code focus]
};
```
Expand All @@ -118,7 +130,7 @@ Can be added to `@PersonalData.EntitySemantics: 'DataSubject'`. It's a user-chos
In our model, we can add the `DataSubjectRole` as follows:

```cds
annotate db.Customers with @PersonalData: {
annotate my.Customers with @PersonalData: {
EntitySemantics: 'DataSubject',
DataSubjectRole: 'Customer' // [!code focus]
};
Expand All @@ -137,15 +149,15 @@ Use this annotation to identify data subject's unique key, or a reference to it.
Hence, we annotate our model as follows:

```cds
annotate db.Customers with {
annotate my.Customers with {
ID @PersonalData.FieldSemantics: 'DataSubjectID' // [!code focus]
};
annotate db.Addresses with {
annotate my.Addresses with {
customer @PersonalData.FieldSemantics: 'DataSubjectID' // [!code focus]
};
annotate db.Incidents with {
annotate my.Incidents with {
customer @PersonalData.FieldSemantics: 'DataSubjectID' // [!code focus]
};
```
Expand All @@ -157,7 +169,7 @@ annotate db.Incidents with {
`@PersonalData.IsPotentiallyPersonal` tags which fields are personal and, for example, require audit logs if modified.

```cds
annotate db.Customers with {
annotate my.Customers with {
firstName @PersonalData.IsPotentiallyPersonal; // [!code focus]
lastName @PersonalData.IsPotentiallyPersonal; // [!code focus]
email @PersonalData.IsPotentiallyPersonal; // [!code focus]
Expand All @@ -172,7 +184,7 @@ annotate db.Customers with {
`@PersonalData.IsPotentiallySensitive` tags which fields are sensitive and, for example, require audit logs in case of access.

```cds
annotate db.Customers with {
annotate my.Customers with {
creditCardNo @PersonalData.IsPotentiallySensitive; // [!code focus]
};
```
Expand Down
5 changes: 5 additions & 0 deletions guides/data-privacy/pdm.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ SAP BTP provides the [*SAP Personal Data Manager (PDM)*](https://help.sap.com/do

[[toc]]

## Annotate Personal Data

First identify entities and elements (potentially) holding personal data using `@PersonalData` annotations, as explained in detail in the [*Annotating Personal Data* chapter](annotations) of these guides.

> We keep using the [Incidents Management reference sample app](https://github.com/cap-js/incidents-app).
## Provide a Service Interface to SAP Personal Data Manager

Expand Down

0 comments on commit 387364d

Please sign in to comment.