Commit 20f4be97 authored by Boiget Boiget's avatar Boiget Boiget

Check if keycloak is enabled

parent 0a8d8465
Pipeline #2189 passed with stages
in 5 minutes and 24 seconds
......@@ -88,7 +88,7 @@ export const createGroup = new ValidatedMethod({
});
Roles.addUsersToRoles(this.userId, 'admin', groupId);
favGroup._execute({ userId: this.userId }, { groupId });
if (Meteor.isServer) {
if (Meteor.isServer && Meteor.settings.public.enableKeycloak) {
// create associated groups and roles in keycloak
kcClient.addGroup({ name });
}
......@@ -114,7 +114,7 @@ export const removeGroup = new ValidatedMethod({
if (!authorized) {
throw new Meteor.Error('api.groups.removeGroup.notPermitted', i18n.__('api.groups.adminGroupNeeded'));
}
if (Meteor.isServer) {
if (Meteor.isServer && Meteor.settings.public.enableKeycloak) {
// delete associated groups and roles in keycloak
kcClient.removeGroup(group);
}
......
......@@ -396,6 +396,6 @@ class KeyCloakClient {
}
}
const kcClient = Meteor.isServer ? new KeyCloakClient() : null;
const kcClient = Meteor.isServer && Meteor.settings.public.enableKeycloak ? new KeyCloakClient() : null;
export default kcClient;
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