Bugzilla – Attachment 185634 Details for
Bug 38924
Introduce an organization level loan 'Quota' system for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38924: Add quotas permissions
Bug-38924-Add-quotas-permissions.patch (text/plain), 4.84 KB, created by
Victor Grousset/tuxayo
on 2025-08-21 17:24:57 UTC
(
hide
)
Description:
Bug 38924: Add quotas permissions
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2025-08-21 17:24:57 UTC
Size:
4.84 KB
patch
obsolete
>From 92b8a2e5e16771ad984d979ae36c283bcfde590b Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <jacobomara901@gmail.com> >Date: Thu, 30 Jan 2025 10:37:08 +0000 >Subject: [PATCH] Bug 38924: Add quotas permissions > >This patch adds the new quotas permissions to the system > >Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../mysql/atomicupdate/bug_38924-patron_quotas.pl | 11 +++++++++-- > installer/data/mysql/mandatory/userpermissions.sql | 2 ++ > .../intranet-tmpl/prog/en/includes/permissions.inc | 6 ++++++ > t/Koha/Auth/Permissions.t | 2 ++ > 4 files changed, 19 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl >index 848fe85c66..275fb1b4e9 100755 >--- a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl >+++ b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl >@@ -3,7 +3,7 @@ use Koha::Installer::Output qw(say_warning say_success say_info); > > return { > bug_number => "38924", >- description => "Add patron quota table", >+ description => "Add patron quota table and permissions", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >@@ -25,7 +25,14 @@ return { > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > } > ); >- say_success( $out, "Patron quota table created successfully" ); >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES >+ (4, 'manage_borrower_quotas', 'Manage patron quotas'), >+ (4, 'view_borrower_quotas', 'View patron quotas') >+ }); >+ >+ say_success( $out, "Patron quota table and permissions created successfully" ); > } else { > say_info( $out, "Patron quota table already exists" ); > } >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 1ff3f33d1e..4131130270 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -48,8 +48,10 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 4, 'delete_borrowers', 'Delete patrons'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), > ( 4, 'list_borrowers', 'Search, list and view patrons'), >+ ( 4, 'manage_borrower_quotas', 'Manage patron quotas'), > ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), >+ ( 4, 'view_borrower_quotas', 'View patron quotas'), > ( 6, 'place_holds', 'Place holds for patrons'), > ( 6, 'modify_holds_priority', 'Modify holds priority'), > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index aa331ee7cf..89c7fa6272 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -550,6 +550,12 @@ > [%- CASE 'marc_order_manage' -%] > <span class="sub_permission marc_order_manage_subpermission"> Manage MARC ordering </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'view_borrower_quotas' -%] >+ <span class="sub_permission view_borrower_quotas_subpermission"> View patron quotas </span> >+ <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'manage_borrower_quotas' -%] >+ <span class="sub_permission manage_borrower_quotas_subpermission"> Manage patron quotas </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'reopen_closed_invoices' -%] > <span class="sub_permission reopen_closed_invoices_subpermission"> Reopen closed invoices </span> > <span class="permissioncode">([% name | html %])</span> >diff --git a/t/Koha/Auth/Permissions.t b/t/Koha/Auth/Permissions.t >index 0fc4ba108a..47490b055f 100755 >--- a/t/Koha/Auth/Permissions.t >+++ b/t/Koha/Auth/Permissions.t >@@ -130,6 +130,8 @@ subtest 'superlibrarian tests' => sub { > 'CAN_user_borrowers_edit_borrowers' => 1, > 'CAN_user_borrowers_list_borrowers' => 1, > 'CAN_user_borrowers_api_validate_password' => 1, >+ 'CAN_user_borrowers_manage_borrower_quotas' => 1, >+ 'CAN_user_borrowers_view_borrower_quotas' => 1, > 'CAN_user_borrowers_view_borrower_infos_from_any_libraries' => 1, > 'CAN_user_borrowers' => 1, > 'CAN_user_cash_management_anonymous_refund' => 1, >-- >2.50.1
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 38924
:
178582
|
178583
|
178584
|
178585
|
178586
|
178587
|
178588
|
178589
|
178590
|
178591
|
178592
|
178593
|
178594
|
178595
|
178596
|
178597
|
178598
|
178599
|
178600
|
178601
|
178602
|
178603
|
178604
|
178605
|
178606
|
178607
|
178608
|
185631
|
185632
|
185633
|
185634
|
185635
|
185636
|
185637
|
185638
|
185639
|
185640
|
185641
|
185642
|
185643
|
185644
|
185645
|
185646
|
185647
|
185648
|
185649
|
185650
|
185651
|
185652
|
185653
|
185654
|
185655
|
185656
|
185657
|
185675
|
185676
|
185677
|
185678
|
185679
|
185680
|
185681
|
185682
|
185683
|
185684
|
185685
|
185686
|
185687
|
185688
|
185689
|
185690
|
185691
|
185692
|
185693
|
185694
|
185695
|
185696
|
185697
|
185698
|
185699
|
185700
|
185701
|
185702