1 # ---------------------------------------------------------------
2 # Copyright (C) 2011 Merrimack Valley Library Consortium
3 # Jason Stephenson <jstephenson@mvlc.org>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 # ---------------------------------------------------------------
15 package OpenILS::WWW::PhoneList::Base;
20 # A base class for generating phone list output.
22 use OpenILS::Application::AppUtils;
35 my $class = ref($invocant) || $invocant;
37 _permitted => \%fields,
41 $self->authtoken($args->{authtoken});
42 $self->user($args->{user});
43 $self->work_ou($args->{work_ou});
50 if ($self->perms && $self->user && $self->authtoken && $self->work_ou) {
51 my $r = OpenILS::Application::AppUtils->simplereq('open-ils.actor', 'open-ils.actor.user.perm.check', $self->authtoken, $self->user, $self->work_ou, $self->perms);
57 # Return empty array ref.
62 # Always return false.
69 my $class = ref($self) or croak "$self is not an object";
70 my $name = our $AUTOLOAD;
74 unless (exists $self->{_permitted}->{$name}) {
75 croak "Can't access '$name' field of class '$class'";
79 return $self->{$name} = shift;
81 return $self->{$name};