Bugzilla – Attachment 147833 Details for
Bug 31793
Add DELETE endpoint for Authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31793: (QA follow-up) Require editauthorities flag
Bug-31793-QA-follow-up-Require-editauthorities-fla.patch (text/plain), 2.64 KB, created by
Marcel de Rooy
on 2023-03-07 12:45:18 UTC
(
hide
)
Description:
Bug 31793: (QA follow-up) Require editauthorities flag
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-07 12:45:18 UTC
Size:
2.64 KB
patch
obsolete
>From 374a88d7f7552e50f3746a228974be20e05fd439 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 6 Mar 2023 17:39:14 -0300 >Subject: [PATCH] Bug 31793: (QA follow-up) Require editauthorities flag >Content-Type: text/plain; charset=utf-8 > >This patch makes the route require the right permissions. Tests are >adjusted to reflect this new situation. > >To test: >1. Apply this patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/authorities.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > api/v1/swagger/paths/authorities.yaml | 8 ++------ > t/db_dependent/api/v1/authorities.t | 14 ++------------ > 2 files changed, 4 insertions(+), 18 deletions(-) > >diff --git a/api/v1/swagger/paths/authorities.yaml b/api/v1/swagger/paths/authorities.yaml >index 0b47d41389..80c85d1a04 100644 >--- a/api/v1/swagger/paths/authorities.yaml >+++ b/api/v1/swagger/paths/authorities.yaml >@@ -74,11 +74,7 @@ > schema: > $ref: "../swagger.yaml#/definitions/error" > "404": >- description: Biblio not found >- schema: >- $ref: "../swagger.yaml#/definitions/error" >- "409": >- description: Unable to perform action on biblio >+ description: Authority not found > schema: > $ref: "../swagger.yaml#/definitions/error" > "500": >@@ -91,4 +87,4 @@ > $ref: "../swagger.yaml#/definitions/error" > x-koha-authorization: > permissions: >- editcatalogue: edit_catalogue >+ editauthorities: "1" >diff --git a/t/db_dependent/api/v1/authorities.t b/t/db_dependent/api/v1/authorities.t >index 13e101f951..0f20376c4c 100755 >--- a/t/db_dependent/api/v1/authorities.t >+++ b/t/db_dependent/api/v1/authorities.t >@@ -141,17 +141,7 @@ subtest 'delete() tests' => sub { > $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid) > ->status_is(403, 'Not enough permissions makes it return the right code'); > >- # Add permissions >- $builder->build( >- { >- source => 'UserPermission', >- value => { >- borrowernumber => $patron->borrowernumber, >- module_bit => 9, >- code => 'edit_catalogue' >- } >- } >- ); >+ $patron->flags( 2 ** 14 )->store; # 14 => editauthorities userflag > > $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid) > ->status_is(204, 'SWAGGER3.2.4') >@@ -161,4 +151,4 @@ subtest 'delete() tests' => sub { > ->status_is(404); > > $schema->storage->txn_rollback; >-}; >\ No newline at end of file >+}; >-- >2.30.2
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 31793
:
144472
|
144705
|
147808
|
147809
|
147810
|
147831
|
147832
| 147833