Bug 33440: Added permission requirements to unauthorized_transfer
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0edf689870)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
4efb86aec8
commit
acae50f177
|
|
@ -439,6 +439,19 @@ sub cannot_be_transferred {
|
|||
if ( !Koha::Patrons->find($to) ) {
|
||||
return 'new_owner_not_found';
|
||||
}
|
||||
my $to_patron = Koha::Patrons->find($to);
|
||||
|
||||
if ( $self->public ) {
|
||||
return 'unauthorized_transfer'
|
||||
unless C4::Auth::haspermission(
|
||||
$to_patron->userid,
|
||||
{
|
||||
lists => [
|
||||
'create_public_lists', 'delete_public_lists', 'edit_public_list_contents', 'edit_public_lists'
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
if ( !$self->public && !$shares->search( { borrowernumber => $to } )->count ) {
|
||||
return 'new_owner_has_no_share';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue