Skip to content
Snippets Groups Projects
Verified Commit dc1984eb authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Dalsi oprava Auth

parent 4284437c
Branches
No related tags found
No related merge requests found
Pipeline #19975 passed
...@@ -2,7 +2,7 @@ image: docker:latest ...@@ -2,7 +2,7 @@ image: docker:latest
variables: variables:
DOCKER_TLS_CERTDIR: "/certs" DOCKER_TLS_CERTDIR: "/certs"
IMAGE_VER: 0.21.4 IMAGE_VER: 0.21.5
services: services:
- docker:dind - docker:dind
......
...@@ -76,6 +76,7 @@ sub register ( $class, $self, $conf) { ...@@ -76,6 +76,7 @@ sub register ( $class, $self, $conf) {
$self->helper( oauth_main_group => sub ( $c ) { $self->helper( oauth_main_group => sub ( $c ) {
my $claims = $c->oauth_claims // return; my $claims = $c->oauth_claims // return;
my $cen_regp;
GROUP: GROUP:
foreach my $group ( sort @{ $claims->{groups} } ) { foreach my $group ( sort @{ $claims->{groups} } ) {
...@@ -90,13 +91,18 @@ sub register ( $class, $self, $conf) { ...@@ -90,13 +91,18 @@ sub register ( $class, $self, $conf) {
role => $role, role => $role,
}; };
} }
elsif ( $group =~ /cen:regp/ ) { if ( $group =~ /cen:regp/ ) {
$cen_regp = 1;
}
}
if ( $cen_regp ) {
return { return {
region => '', region => 'Praha',
role => 'regp', role => 'regp',
}; };
} }
}
}); });
$self->helper( user => sub ( $c ) { $self->helper( user => sub ( $c ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment