Exemple #1
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var    Usermanager = HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>();
            var    currentuser = Usermanager.FindByName(HttpContext.Current.User.Identity.Name);
            var    lst         = httpContext.Request.RequestContext.RouteData.Values.Values.ToList();
            object actionname  = lst[1];
            bool   check       = false;

            check = Commonhelper.checkpermission(currentuser.Id, Action, Permission);
            return(check);
            //check your permissions
        }