Ejemplo n.º 1
0
 protected override IAsyncResult BeginExecuteCore(AsyncCallback callback, object state)
 {
     if (HttpContext.User.Identity.IsAuthenticated)
     {
         var authenticatedUserModel = AuthenticatedUserModel.GetFromJSON(HttpContext.User.Identity.Name);
         usuario         = usuarioRepository.Get(authenticatedUserModel.ID);
         ViewBag.Usuario = usuario;
     }
     return(base.BeginExecuteCore(callback, state));
 }
Ejemplo n.º 2
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            IIdentity identity = httpContext.User.Identity;
            var       authenticatedUserModel = AuthenticatedUserModel.GetFromJSON(identity.Name);

            if (authenticatedUserModel != null && identity.IsAuthenticated)
            {
                return(true);
            }
            httpContext.Response.Redirect(FormsAuthentication.LoginUrl);
            return(false);
        }
Ejemplo n.º 3
0
 protected override bool AuthorizeCore(HttpContextBase httpContext)
 {
     if (httpContext.User != null && httpContext.User.Identity.IsAuthenticated)
     {
         var authenticatedUserModal = AuthenticatedUserModel.GetFromJSON(httpContext.User.Identity.Name);
         if (authenticatedUserModal.AccessGroups.Any(g => this.GroupName.Any(n => n.ToLowerInvariant() == g.ToLowerInvariant())))
         {
             return(true);
         }
     }
     httpContext.Response.Redirect(FormsAuthentication.LoginUrl);
     return(false);
 }