diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml
index a2e86ec2a8..7efa3bceb7 100644
--- a/api/v1/swagger/paths/patrons.yaml
+++ b/api/v1/swagger/paths/patrons.yaml
@@ -397,6 +397,7 @@
- tools: "label_creator"
- serials: "routing"
- acquisition: "order_manage"
+ - borrowers: "list_borrowers"
post:
x-mojo-to: Patrons#add
operationId: addPatron
diff --git a/installer/data/mysql/atomicupdate/bug_30230_add-new-list-borrowers-permission.pl b/installer/data/mysql/atomicupdate/bug_30230_add-new-list-borrowers-permission.pl
new file mode 100755
index 0000000000..88772b4886
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug_30230_add-new-list-borrowers-permission.pl
@@ -0,0 +1,16 @@
+use Modern::Perl;
+
+return {
+ bug_number => "BUG_30230",
+ description => "Add new list_borrowers permission",
+ up => sub {
+ my ($args) = @_;
+ my ( $dbh, $out ) = @$args{qw(dbh out)};
+
+ $dbh->do(
+ "INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (4, 'list_borrowers', 'Search and list patrons')"
+ );
+
+ say $out "Added new permission 'list_borrowers'";
+ },
+};
diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql
index 7e52abd262..ad51b5736c 100644
--- a/installer/data/mysql/mandatory/userpermissions.sql
+++ b/installer/data/mysql/mandatory/userpermissions.sql
@@ -45,6 +45,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
( 3, 'manage_identity_providers', 'Manage identity providers'),
( 4, 'delete_borrowers', 'Delete patrons'),
( 4, 'edit_borrowers', 'Add, modify and view patron information'),
+ ( 4, 'list_borrowers', 'Search and list patrons'),
( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
( 6, 'place_holds', 'Place holds for patrons'),
( 6, 'modify_holds_priority', 'Modify holds priority'),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc
index b3a21080be..cbb8c8bda9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc
@@ -14,9 +14,11 @@
[% END %]
- -
- Search patrons
-
+ [% IF ( CAN_user_circulate ) %]
+ -
+ Search patrons
+
+ [% END %]
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
-
Check out
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
index 10b90813f4..42b4da1e10 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
@@ -312,6 +312,11 @@
Add, modify and view patron information
([% name | html %])
+ [%- CASE 'list_borrowers' -%]
+
+ Search and list patrons
+
+ ([% name | html %])
[%- CASE 'view_borrower_infos_from_any_libraries' -%]
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.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
index c066fe3ace..845d7759eb 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
@@ -64,7 +64,7 @@
[% END %]
- [% IF CAN_user_borrowers_edit_borrowers %]
+ [% IF (CAN_user_borrowers_edit_borrowers) || (CAN_user_borrowers_list_borrowers) %]
-
Patrons
diff --git a/members/member.pl b/members/member.pl
index 30ba11bc8c..6f63ec5166 100755
--- a/members/member.pl
+++ b/members/member.pl
@@ -37,7 +37,7 @@ my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/member.tt",
query => $input,
type => "intranet",
- flagsrequired => {borrowers => 'edit_borrowers'},
+ flagsrequired => { borrowers => ['edit_borrowers', 'list_borrowers'] },
});
my $theme = $input->param('theme') || "default";
diff --git a/members/members-home.pl b/members/members-home.pl
index 22d341bbbb..ae0a7b1d57 100755
--- a/members/members-home.pl
+++ b/members/members-home.pl
@@ -35,7 +35,7 @@ my ($template, $loggedinuser, $cookie, $flags)
= get_template_and_user({template_name => "members/member.tt",
query => $query,
type => "intranet",
- flagsrequired => {borrowers => 'edit_borrowers'},
+ flagsrequired => { borrowers => ['edit_borrowers', 'list_borrowers'] },
});
my $no_add = 0;
diff --git a/members/moremember.pl b/members/moremember.pl
index 7a419e9fb9..2f70c48705 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -62,7 +62,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
template_name => $template_name,
query => $input,
type => "intranet",
- flagsrequired => { borrowers => 'edit_borrowers' },
+ flagsrequired => { borrowers => ['edit_borrowers', 'list_borrowers'] },
}
);
my $borrowernumber = $input->param('borrowernumber');