using System.Net; using System.Web; using System.Web.Mvc; using Kreta.BusinessLogic.Helpers.SystemSettings; using Kreta.Web.Helpers; namespace Kreta.Web.Security { public class MvcCsokkentettGondviseloAccessAttribute : ActionFilterAttribute { public MvcCsokkentettGondviseloAccessAttribute() { } public override void OnActionExecuting(ActionExecutingContext filterContext) { var result = new SystemSettingsHelper(ConnectionTypeExtensions.GetOrganizationConnectionType()).GetSystemSettingValue(Enums.RendszerBeallitasTipusEnum.Csokkentett_gondviselok_kezelese); if (!result) { filterContext.Result = new EmptyResult(); HttpContext.Current.Response.StatusCode = (int)HttpStatusCode.Unauthorized; HttpContext.Current.Response.End(); } } } }