From d94983c3499ca9676aecd738d7dea6d68b86f558 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 Nov 2019 14:11:34 +0000 Subject: [PATCH] Bug 23634: Add is_superlibrarian method to Koha::Patron Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Marcel de Rooy Signed-off-by: Aleisha Amohia (cherry picked from commit c19855ca5ecf58f0dfb2068172bd6dda6c5b6c1c) Signed-off-by: Victor Grousset/tuxayo --- Koha/Patron.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index a37e151b8d..b0e667fe12 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1215,6 +1215,19 @@ sub has_permission { return C4::Auth::haspermission( $self->userid, $flagsrequired ); } +=head3 is_superlibrarian + + my $is_superlibrarian = $patron->is_superlibrarian; + +Return true if the patron is a superlibrarian. + +=cut + +sub is_superlibrarian { + my ($self) = @_; + return $self->has_permission( { superlibrarian => 1 } ); +} + =head3 is_adult my $is_adult = $patron->is_adult -- 2.39.5