package com.atlassian.stash.internal.web.conditions;

import com.atlassian.crowd.manager.recovery.RecoveryModeService;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.web.Condition;

import java.util.Map;

public class RecoveryModeOnCondition implements Condition {

    private final RecoveryModeService recoveryModeService;

    public RecoveryModeOnCondition(RecoveryModeService recoveryModeService) {
        this.recoveryModeService = recoveryModeService;
    }

    @Override
    public void init(Map<String, String> params) throws PluginParseException {
    }

    @Override
    public boolean shouldDisplay(Map<String, Object> context) {
        return recoveryModeService.isRecoveryModeOn();
    }
}
