2 use strict; use warnings;
3 use Template qw(:template);
4 use OpenSRF::Utils::SettingsClient;
5 use OpenILS::Utils::Fieldmapper;
6 use OpenSRF::EX qw(:try);
7 use OpenSRF::AppSession;
9 # ----------------------------------------------------------------------------------
10 # These permission strings
11 # ----------------------------------------------------------------------------------
13 # returns a new fieldmapper::perm_ex
17 my($class, $type) = @_;
18 $class = ref($class) || $class;
20 my $self = new Fieldmapper::perm_ex;
22 $self->err_msg(_find_perm_string($type));
24 warn "perm type is $type\n";
29 sub _find_perm_string {
34 my $conf = OpenSRF::Utils::SettingsClient->new;
36 my $script = $conf->config_value("perm_script");
38 my $template = Template->new(
45 my $status = $template->process($script, { type => $type });
48 throw OpenSRF::EX::ERROR
49 ("Unable to process exception script. No meaningful data to return..." .
50 " Error is:\n" . $template->error() . "\n");
53 $result =~ s/^\s*//og;
54 warn " -|-|-|- Perm Exception result [$result]\n";