Пример #1
0
        //protected virtual ActionResult OnAuthorization(ControllerContext controllerContext, IEnumerable<FunctionAttribute> functions)
        //{
        //    if (functions != null && functions.Count() > 0)
        //    {
        //        var lastFunction = functions.Last();
        //        var modulePermission = ModuleInfo.Permissions.Where(mp => mp.FunctionName == lastFunction.Name).FirstOrDefault();
        //        var user = controllerContext.RequestContext.HttpContext.User;
        //        bool authorizated = ModuleInfo.IsAuthorized(lastFunction.Name, user);
        //        if (!authorizated)
        //        {
        //            ActionResult actionResult = null;

        //            if (actionResult == null && !StringExtensions.IsNullOrEmptyTrim(ModuleInfo.ModuleSettings.UnauthorizedUrl))
        //            {
        //                actionResult = ((ModuleController)controllerContext.Controller).ActionResultHelper.Redirect(controllerContext.HttpContext.Response.ApplyAppPathModifier(ModuleInfo.ModuleSettings.UnauthorizedUrl));
        //            }
        //            if (actionResult == null)
        //            {
        //                actionResult = new ContentResult() { Content = Resources.ModuleUnauthorizated };
        //            }
        //            return actionResult;
        //        }
        //    }
        //    return null;
        //}
        #endregion

        #region ExecuteActionResult
        /// <summary>
        /// Executes the action result.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <param name="actionName">Name of the action.</param>
        /// <param name="actionResult">The action result.</param>
        public ModuleResultExecutedContext ExecuteActionResult(ModuleActionInvokedContext actionInvokedContext)
        {
            var        actionName = actionInvokedContext.ControllerContext.RouteData.GetRequiredString("action");
            FilterInfo filters    = this.GetFilters(actionInvokedContext.ControllerContext, actionName);

            return(this.CustomInvokeActionResultWithFilters(actionInvokedContext.ControllerContext, filters.ResultFilters, actionInvokedContext.ActionResult));
        }
Пример #2
0
 public static ModuleResultExecutedContext ExecuteActionResult(ModuleActionInvokedContext actionInvokedContext)
 {
     return actionInvoker.ExecuteActionResult(actionInvokedContext);
 }
Пример #3
0
 public static ModuleResultExecutedContext ExecuteActionResult(ModuleActionInvokedContext actionInvokedContext)
 {
     return(actionInvoker.ExecuteActionResult(actionInvokedContext));
 }