Beispiel #1
0
        public void OnAuthorization(AuthorizationFilterContext context)
        {
            var isAuthenticate = GoblinUiAuthHelper.IsAuthenticated(context);

            if (!isAuthenticate)
            {
                context.Result = new RedirectToActionResult("Login", "Auth", null, false);

                return;
            }

            var isAuthorization = GoblinUiAuthHelper.IsAuthorized(context);

            if (!isAuthorization)
            {
                context.Result = new RedirectToActionResult("Error", "Home", new { code = StatusCodes.Status403Forbidden }, false);
            }
        }
Beispiel #2
0
 public void OnAuthorization(AuthorizationFilterContext context)
 {
     GoblinUiAuthHelper.BindLoggedInUser(context.HttpContext);
 }