Lines 709-714
sub account_locked {
Link Here
|
709 |
and $self->login_attempts >= $FailedLoginAttempts )? 1 : 0; |
709 |
and $self->login_attempts >= $FailedLoginAttempts )? 1 : 0; |
710 |
} |
710 |
} |
711 |
|
711 |
|
|
|
712 |
=head3 can_see_patron_infos |
713 |
|
714 |
my $can_see = $patron->can_see_patron_infos( $patron ); |
715 |
|
716 |
Return true if the patron (usually the logged in user) can see the patron's infos for a given patron |
717 |
|
718 |
=cut |
719 |
|
720 |
sub can_see_patron_infos { |
721 |
my ( $self, $patron ) = @_; |
722 |
my $can = 0; |
723 |
if ( $self->branchcode eq $patron->branchcode ) { |
724 |
$can = 1; |
725 |
} elsif ( $self->can( { borrowers => 'view_borrower_infos_from_any_libraries' } ) ) { |
726 |
$can = 1; |
727 |
} elsif ( my $library_groups = $self->library->library_groups ) { |
728 |
while ( my $library_group = $library_groups->next ) { |
729 |
if ( $library_group->parent->has_child( $patron->library->branchcode ) ) { |
730 |
$can = 1; |
731 |
last; |
732 |
} |
733 |
} |
734 |
} |
735 |
return $can; |
736 |
} |
737 |
|
738 |
sub can { |
739 |
my ( $self, $flagsrequired ) = @_; |
740 |
return unless $self->userid; |
741 |
# TODO code from haspermission needs to be moved here! |
742 |
return C4::Auth::haspermission( $self->userid, $flagsrequired ); |
743 |
} |
744 |
|
712 |
=head3 type |
745 |
=head3 type |
713 |
|
746 |
|
714 |
=cut |
747 |
=cut |
715 |
- |
|
|