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

Umozneno lokalni mapovani skupin na role

parent f59b2a57
No related branches found
No related tags found
No related merge requests found
Pipeline #1995 passed
......@@ -3,7 +3,7 @@ image: docker:19.03.1
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: $CI_REGISTRY_IMAGE
IMAGE_VER: 1.7.0
IMAGE_VER: 1.8.0
services:
- docker:19.03.1-dind
......
......@@ -94,9 +94,23 @@ sub register ( $class, $self, $conf) {
@roles = split /\W+/, $c->req->headers('X-Roles');
}
elsif ( my $claims = $c->oauth_claims ) {
if ( $c->cfg->{groups_to_roles_map} ) {
GROUP:
foreach my $group ( sort @{ $claims->{groups} } ) {
if ($c->cfg->{groups_to_roles_map} =~ /$group=(\w+)/x) {
push @roles, $1;
}
}
}
else {
@roles = @{ $claims->{roles} // [] };
}
}
$c->trace(join '=', @roles);
$c->stash->{user_roles} //= { map { $_ => 1 } @roles };
return $c->stash->{user_roles};
});
......
openapi: 3.0.3
info:
version: 1.7.0
version: 1.8.0
title: CF Online
description: CF Online
license:
......@@ -124,6 +124,7 @@ components:
type: string
jitsi_url:
type: string
nullable: true
is_banned:
type: boolean
Announcement:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment