moved to new perm style { ilsevent => 5000, ilsperm => $name }
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 5 Dec 2005 20:50:33 +0000 (20:50 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 5 Dec 2005 20:50:33 +0000 (20:50 +0000)
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

index 211147d..dcd2b64 100644 (file)
@@ -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;