using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Http;

namespace MEU.API.Utils
{
    public class RouteData : AuthorizeAttribute
    {
        protected bool bAllowAccess = false;
        string sKeyData = "";
        public RouteData(string sData)
        {
            sKeyData = sData;
           
        }
        public void OnAuthorization(AuthorizationFilterContext context)
        {
            //Return based on logic
            if (sKeyData!="thienvo")
            {
                context.Result = new UnauthorizedResult();
            }
            
        }

    }
}
