Commit b03558c5 authored by Xavier Guimard's avatar Xavier Guimard

Finish #1330

parent d0579aec
......@@ -61,7 +61,7 @@ sub loadApp {
if ( length $rule ) {
$rule = $self->p->HANDLER->substitute($rule);
unless ( $rule = $self->p->HANDLER->buildSub($rule) ) {
$self->error( 'OIDC RP rule error: '
$self->error( 'CAS App rule error: '
. $self->p->HANDLER->tsv->{jail}->error );
return 0;
}
......
......@@ -65,6 +65,11 @@ has beforeLogout => (
default => sub { [] }
);
has spRules => (
is => 'rw',
default => sub { {} }
);
# Custom template parameters
has customParameters => ( is => 'rw', default => sub { {} } );
......@@ -313,6 +318,8 @@ sub findEP {
}
}
}
( $obj and $obj->init ) or return 0;
$self->logger->debug("Plugin $plugin initializated");
# Rules for menu
if ( $obj->can('spRules') ) {
......@@ -323,8 +330,6 @@ sub findEP {
$self->spRules->{$k} = $obj->{spRules}->{$k};
}
}
( $obj and $obj->init ) or return 0;
$self->logger->debug("Plugin $plugin initializated");
return $obj;
}
......
......@@ -425,10 +425,10 @@ sub _filterHash {
# Handle partner rules (SAML, CAS or OIDC)
if ( $appdisplay =~ /^partner:\s*(.*)$/ ) {
my $p = $1;
if ( my $sub = $self->spRules->{$p} ) {
if ( my $sub = $self->p->spRules->{$p} ) {
eval {
delete $apphash->{$key}
unless ( $p->( $req, $req->sessionInfo ) );
unless ( $sub->( $req, $req->sessionInfo ) );
};
if ($@) {
$self->logger->error("Partner rule $p returns: $@");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment