|
Lines 736-742
sub can_see_patrons_from {
Link Here
|
| 736 |
my $can = 0; |
736 |
my $can = 0; |
| 737 |
if ( $self->branchcode eq $branchcode ) { |
737 |
if ( $self->branchcode eq $branchcode ) { |
| 738 |
$can = 1; |
738 |
$can = 1; |
| 739 |
} elsif ( $self->can( { borrowers => 'view_borrower_infos_from_any_libraries' } ) ) { |
739 |
} elsif ( $self->has_permission( { borrowers => 'view_borrower_infos_from_any_libraries' } ) ) { |
| 740 |
$can = 1; |
740 |
$can = 1; |
| 741 |
} elsif ( my $library_groups = $self->library->library_groups ) { |
741 |
} elsif ( my $library_groups = $self->library->library_groups ) { |
| 742 |
while ( my $library_group = $library_groups->next ) { |
742 |
while ( my $library_group = $library_groups->next ) { |
|
Lines 773-779
sub libraries_where_can_see_patrons {
Link Here
|
| 773 |
} |
773 |
} |
| 774 |
else { |
774 |
else { |
| 775 |
unless ( |
775 |
unless ( |
| 776 |
$self->can( |
776 |
$self->has_permission( |
| 777 |
{ borrowers => 'view_borrower_infos_from_any_libraries' } |
777 |
{ borrowers => 'view_borrower_infos_from_any_libraries' } |
| 778 |
) |
778 |
) |
| 779 |
) |
779 |
) |
|
Lines 798-804
sub libraries_where_can_see_patrons {
Link Here
|
| 798 |
return sort (@restricted_branchcodes); |
798 |
return sort (@restricted_branchcodes); |
| 799 |
} |
799 |
} |
| 800 |
|
800 |
|
| 801 |
sub can { |
801 |
sub has_permission { |
| 802 |
my ( $self, $flagsrequired ) = @_; |
802 |
my ( $self, $flagsrequired ) = @_; |
| 803 |
return unless $self->userid; |
803 |
return unless $self->userid; |
| 804 |
# TODO code from haspermission needs to be moved here! |
804 |
# TODO code from haspermission needs to be moved here! |