From 4c4f1c719ade9e019f606c7430a354c08c29e00a Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 5 Dec 2005 20:50:33 +0000 Subject: [PATCH] moved to new perm style { ilsevent => 5000, ilsperm => $name } the clients can now work out the permission message git-svn-id: svn://svn.open-ils.org/ILS/trunk@2228 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Perm.pm | 48 +++------------------------ 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Perm.pm b/Open-ILS/src/perlmods/OpenILS/Perm.pm index 211147d3d7..dcd2b64645 100644 --- a/Open-ILS/src/perlmods/OpenILS/Perm.pm +++ b/Open-ILS/src/perlmods/OpenILS/Perm.pm @@ -5,59 +5,19 @@ use OpenSRF::Utils::SettingsClient; use OpenILS::Utils::Fieldmapper; use OpenSRF::EX qw(:try); use OpenSRF::AppSession; +use OpenSRF::Utils::Logger; # ---------------------------------------------------------------------------------- # These permission strings # ---------------------------------------------------------------------------------- # returns a new fieldmapper::perm_ex +my $logger = 'OpenSRF::Utils::Logger'; sub new { - my($class, $type) = @_; - $class = ref($class) || $class; - - my $self = new Fieldmapper::perm_ex; - - $self->err_msg(_find_perm_string($type)); - $self->type($type); - warn "perm type is $type\n"; - return $self; -} - - -sub _find_perm_string { - - my $type = shift; - - my $result; - my $conf = OpenSRF::Utils::SettingsClient->new; - - my $script = $conf->config_value("perm_script"); - - my $template = Template->new( - { - ABSOLUTE => 1, - OUTPUT => \$result, - } - ); - - my $status = $template->process($script, { type => $type }); - - if(!$status) { - throw OpenSRF::EX::ERROR - ("Unable to process exception script. No meaningful data to return..." . - " Error is:\n" . $template->error() . "\n"); - } - - $result =~ s/^\s*//og; - warn " -|-|-|- Perm Exception result [$result]\n"; - - return $result; + $logger->warn("Returning permission error: $type"); + return bless( { ilsevent => 5000, ilsperm => $type }, 'OpenILS::Perm'); } - - - - 1; -- 2.43.2