Bugzilla – Attachment 88217 Details for
Bug 21336
GDPR: Handle unsubscribe requests automatically by optional (administrative) lock, anonymize and remove
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21336: Fix the API
Bug-21336-Fix-the-API.patch (text/plain), 3.62 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-04-17 17:39:51 UTC
(
hide
)
Description:
Bug 21336: Fix the API
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-04-17 17:39:51 UTC
Size:
3.62 KB
patch
obsolete
>From 47e91cf8f3726501fb9d386aeb5bf2ca2244576d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Apr 2019 14:31:27 -0300 >Subject: [PATCH] Bug 21336: Fix the API > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Patrons.pm | 2 ++ > Koha/Schema/Result/Borrower.pm | 3 ++- > api/v1/swagger/definitions/patron.json | 5 +++++ > t/db_dependent/api/v1/patrons.t | 3 +++ > 4 files changed, 12 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 5e8e398eac..e4f7ba1125 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -400,6 +400,7 @@ our $to_api_mapping = { > debarredcomment => undef, # calculated, API consumers will use /restrictions instead > emailpro => 'secondary_email', > flags => undef, # permissions manipulation handled in /permissions >+ flgAnonymized => 'anonymized', > gonenoaddress => 'incorrect_address', > guarantorid => 'guarantor_id', > lastseen => 'last_seen', >@@ -443,6 +444,7 @@ our $to_api_mapping = { > > our $to_model_mapping = { > altaddress_notes => 'contactnote', >+ anonymized => 'flgAnonymized', > category_id => 'categorycode', > check_previous_checkout => 'checkprevcheckout', > date_enrolled => 'dateenrolled', >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index f2fa3bff38..f626ca9e18 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1545,7 +1545,8 @@ __PACKAGE__->belongs_to( > ); > > __PACKAGE__->add_columns( >- '+lost' => { is_boolean => 1 }, >+ '+flgAnonymized' => { is_boolean => 1 }, >+ '+lost' => { is_boolean => 1 }, > '+gonenoaddress' => { is_boolean => 1 } > ); > >diff --git a/api/v1/swagger/definitions/patron.json b/api/v1/swagger/definitions/patron.json >index 5d6ccd82c0..1e87ffce91 100644 >--- a/api/v1/swagger/definitions/patron.json >+++ b/api/v1/swagger/definitions/patron.json >@@ -272,6 +272,11 @@ > "overdrive_auth_token": { > "type": ["string", "null"], > "description": "persist OverDrive auth token" >+ }, >+ "anonymized": { >+ "type": "boolean", >+ "readOnly": true, >+ "description": "If the patron has been anonymized" > } > }, > "additionalProperties": false, >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 6e0b557c87..4f96a12430 100644 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -143,6 +143,7 @@ subtest 'add() tests' => sub { > # delete RO attributes > delete $newpatron->{patron_id}; > delete $newpatron->{restricted}; >+ delete $newpatron->{anonymized}; > > # Create a library just to make sure its ID doesn't exist on the DB > my $library_to_delete = $builder->build_object({ class => 'Koha::Libraries' }); >@@ -189,6 +190,7 @@ subtest 'add() tests' => sub { > # delete RO attributes > delete $newpatron->{patron_id}; > delete $newpatron->{restricted}; >+ delete $newpatron->{anonymized}; > $patron_to_delete->delete; > > $tx = $t->ua->build_tx(POST => "/api/v1/patrons" => json => $newpatron); >@@ -235,6 +237,7 @@ subtest 'update() tests' => sub { > # delete RO attributes > delete $newpatron->{patron_id}; > delete $newpatron->{restricted}; >+ delete $newpatron->{anonymized}; > > my $tx = $t->ua->build_tx(PUT => "/api/v1/patrons/-1" => json => $newpatron ); > $tx->req->cookies({name => 'CGISESSID', value => $session_id}); >-- >2.21.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21336
:
79165
|
79166
|
79167
|
79168
|
79169
|
79170
|
80201
|
80202
|
80203
|
80204
|
80205
|
80206
|
80207
|
80208
|
80213
|
80214
|
80386
|
80387
|
80403
|
81112
|
81113
|
81114
|
81115
|
81116
|
81117
|
81118
|
81119
|
81270
|
81474
|
81475
|
81476
|
81477
|
81478
|
81479
|
81480
|
81481
|
81482
|
81483
|
82051
|
82052
|
82053
|
82054
|
82055
|
82056
|
82057
|
82058
|
82059
|
83202
|
83203
|
83204
|
83205
|
83206
|
83207
|
83208
|
83209
|
83256
|
87158
|
87159
|
87160
|
87161
|
87162
|
87163
|
87164
|
87165
|
87166
|
87167
|
87168
|
87176
|
87177
|
87178
|
87179
|
87180
|
87181
|
87182
|
87183
|
87184
|
87185
|
87387
|
87388
|
87389
|
87390
|
87391
|
87392
|
87393
|
87394
|
87395
|
87396
|
87397
|
87400
|
87401
|
88198
|
88199
| 88217 |
88218