Bugzilla – Attachment 184588 Details for
Bug 40441
/auth/password/validation ( validateUserAndPassword ) requires too much permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40441: Add new permission api_validate_password
Bug-40441-Add-new-permission-apivalidatepassword.patch (text/plain), 3.55 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-07-24 12:20:25 UTC
(
hide
)
Description:
Bug 40441: Add new permission api_validate_password
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-07-24 12:20:25 UTC
Size:
3.55 KB
patch
obsolete
>From c32b18c8d6a3e3bf5315035bacd24597383b9e64 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 23 Jul 2025 18:23:16 -0300 >Subject: [PATCH] Bug 40441: Add new permission api_validate_password > >This patch adds a new permission 'api_validate_password' that will be used >to control access to the /auth/password/validation endpoint. > >The permission is added to: >- userpermissions.sql for new installations >- permissions.inc for display in the staff interface >- atomic update script for existing installations > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../data/mysql/atomicupdate/bug_40441.pl | 23 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 3 +++ > 3 files changed, 27 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_40441.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_40441.pl b/installer/data/mysql/atomicupdate/bug_40441.pl >new file mode 100755 >index 00000000000..5a55db7b9cf >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_40441.pl >@@ -0,0 +1,23 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "40441", >+ description => "Add new permission for validation passwords on the API", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) >+ VALUES (4, 'api_validate_password', 'Validate patron passwords using the API') >+ } >+ ); >+ >+ # permissions >+ say_success( $out, "Added new permission 'borrowers:api_validate_password'" ); >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index d5121c91fd2..1ff3f33d1e5 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -44,6 +44,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 3, 'manage_search_filters', 'Manage custom search filters'), > ( 3, 'manage_identity_providers', 'Manage identity providers'), > ( 3, 'manage_record_sources', 'Manage record sources'), >+ ( 4, 'api_validate_password', 'Validate patron passwords using the API'), > ( 4, 'delete_borrowers', 'Delete patrons'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), > ( 4, 'list_borrowers', 'Search, list and view patrons'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index a0e17a2d418..9ee9543772d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -236,6 +236,9 @@ > View patron infos from any libraries. If not set the logged in user could only access patron infos from its own library or group of libraries. > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'api_validate_password' -%] >+ <span class="sub_permission api_validate_password_subpermission">Validate patron passwords using the API</span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'send_messages_to_borrowers' -%] > <span class="sub_permission send_messages_to_borrowers_subpermission"> Send messages to patrons </span> > <span class="permissioncode">([% name | html %])</span> >-- >2.39.5
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 40441
: 184588 |
184589