feat: move competition setting to ffsaf site
This commit is contained in:
@@ -32,7 +32,7 @@ public class CompteEndpoints {
|
||||
KeycloakService service;
|
||||
|
||||
@Inject
|
||||
JsonWebToken accessToken;
|
||||
JsonWebToken idToken;
|
||||
|
||||
@Inject
|
||||
SecurityIdentity securityIdentity;
|
||||
@@ -53,8 +53,9 @@ public class CompteEndpoints {
|
||||
})
|
||||
public Uni<KeycloakService.UserCompteState> getCompte(@PathParam("id") String id) {
|
||||
return service.fetchCompte(id).call(pair -> vertx.getOrCreateContext().executeBlocking(() -> {
|
||||
if (!securityIdentity.getRoles().contains("federation_admin") && pair.getKey().groups().stream().map(GroupRepresentation::getPath)
|
||||
.noneMatch(s -> s.startsWith("/club/") && GroupeUtils.contains(s, accessToken)))
|
||||
if (!securityIdentity.getRoles().contains("federation_admin") && pair.getKey().groups().stream()
|
||||
.map(GroupRepresentation::getPath)
|
||||
.noneMatch(s -> s.startsWith("/club/") && GroupeUtils.contains(s, idToken)))
|
||||
throw new DForbiddenException();
|
||||
return pair;
|
||||
})).map(Pair::getValue);
|
||||
|
||||
Reference in New Issue
Block a user