Пример #1
0
        private bool?GetPermission(UserProfile profile)



        {
            var  actionService = new CU_ActionService();
            bool result        = false;

            try
            {
                string currentController = string.Empty;
                if (string.IsNullOrEmpty(Controller))
                {
                    //--get Rout Data
                    var routData = HttpContext.Current.Request.RequestContext.RouteData;

                    //--current action.
                    currentController = routData.GetRequiredString("controller");
                }
                else
                {
                    currentController = Controller;
                }
                //--Get User permission.
                profile.Permission = actionService.GetPermission(currentController, profile.Id.Value);

                result = true;
            }
            catch (Exception ex)
            {
                return(null);
            }
            return(result);
        }
Пример #2
0
 public BaseController()
 {
     profile        = (UserProfile)System.Web.HttpContext.Current.Session["_Profile"];
     _ActionService = new CU_ActionService();
 }