#include "get_user_access_config.h"
#include <saas/deploy_manager/server/client/client.h>

namespace NRTYDeploy {
    bool TScriptGetUserAccessConfig::Process(IDeployInfoRequest& request) {
        TString user = request.GetRD().CgiParam.Get("user");
        TString result = request.GetUserAccessControl().GetUserConfig(user, false);
        request.Output() << "HTTP/1.1 200 Ok\r\n\r\n";
        request.Output() << result;
        return true;
    }

    TScriptGetUserAccessConfig::TFactory::TRegistrator<TScriptGetUserAccessConfig> TScriptGetUserAccessConfig::Registrator("get_user_access_config");
}
