24 lines
827 B
C#
24 lines
827 B
C#
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web.Http.Controllers;
|
|
using System.Web.Http.Filters;
|
|
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
|
using Kreta.Web.Helpers;
|
|
|
|
namespace Kreta.Web.Security
|
|
{
|
|
public class ApiCsokkentettGondviseloAccessAttribute : ActionFilterAttribute
|
|
{
|
|
public ApiCsokkentettGondviseloAccessAttribute() { }
|
|
|
|
public override void OnActionExecuting(HttpActionContext actionContext)
|
|
{
|
|
var result = new SystemSettingsHelper(ConnectionTypeExtensions.GetOrganizationConnectionType()).GetSystemSettingValue<bool>(Enums.RendszerBeallitasTipusEnum.Csokkentett_gondviselok_kezelese);
|
|
|
|
if (!result)
|
|
{
|
|
actionContext.Response = new HttpResponseMessage(HttpStatusCode.Unauthorized);
|
|
}
|
|
}
|
|
}
|
|
}
|