Lines 806-816
sub has_permission {
Link Here
|
806 |
return C4::Auth::haspermission( $self->userid, $flagsrequired ); |
806 |
return C4::Auth::haspermission( $self->userid, $flagsrequired ); |
807 |
} |
807 |
} |
808 |
|
808 |
|
|
|
809 |
=head3 is_adult |
810 |
|
811 |
my $is_adult = $patron->is_adult |
812 |
|
813 |
Return true if the patron has a category with a type Adult (A) or Organization (I) |
814 |
|
815 |
=cut |
816 |
|
809 |
sub is_adult { |
817 |
sub is_adult { |
810 |
my ( $self ) = @_; |
818 |
my ( $self ) = @_; |
811 |
return $self->category->category_type =~ /^(A|I)$/ ? 1 : 0; |
819 |
return $self->category->category_type =~ /^(A|I)$/ ? 1 : 0; |
812 |
} |
820 |
} |
813 |
|
821 |
|
|
|
822 |
=head3 is_child |
823 |
|
824 |
my $is_child = $patron->is_child |
825 |
|
826 |
Return true if the patron has a category with a type Child (C) |
827 |
|
828 |
=cut |
814 |
sub is_child { |
829 |
sub is_child { |
815 |
my( $self ) = @_; |
830 |
my( $self ) = @_; |
816 |
return $self->category->category_type eq 'C' ? 1 : 0; |
831 |
return $self->category->category_type eq 'C' ? 1 : 0; |
817 |
- |
|
|