Skip to content

Commit

Permalink
fix: Ability to connect only when the connector is active - MEED-5281 -
Browse files Browse the repository at this point in the history
Meeds-io/meeds#1838 (#22)

Before this change, connectors are listed on the user settings page as possible to connect even if they are not configured
  • Loading branch information
AzmiTouil authored and boubaker committed Jul 3, 2024
1 parent 4bbfb92 commit a6e2bfc
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@
*/
package io.meeds.evm.gamification.plugin;

import io.meeds.evm.gamification.utils.Utils;
import io.meeds.gamification.plugin.ConnectorPlugin;
import io.meeds.gamification.service.ConnectorSettingService;
import org.exoplatform.commons.api.settings.ExoFeatureService;

import static io.meeds.evm.gamification.utils.Utils.CONNECTOR_NAME;

public class EvmConnectorPlugin extends ConnectorPlugin {

private final ConnectorSettingService connectorSettingService;
private final ExoFeatureService featureService;

public EvmConnectorPlugin(ConnectorSettingService connectorSettingsService) {
this.connectorSettingService = connectorSettingsService;
public EvmConnectorPlugin(ExoFeatureService featureService) {
this.featureService = featureService;
}

@Override
public String getConnectorName() {
return Utils.CONNECTOR_NAME;
return CONNECTOR_NAME;
}

@Override
public boolean enabled(String username) {
return featureService.isFeatureActiveForUser("EVMConnector", username);
}

}

0 comments on commit a6e2bfc

Please sign in to comment.