Ejemplo n.º 1
0
        public ActionResult Delete(string id)
        {
            var moduleModel  = new ModuleModel();
            var deleteModule = moduleModel.GetSpecificModule(int.Parse(id));

            return(View(deleteModule));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(string id)
        {
            var moduleModel  = new ModuleModel();
            var moduleToEdit = moduleModel.GetSpecificModule(int.Parse(id));

            return(View(moduleToEdit));
        }
Ejemplo n.º 3
0
        public CustomAuthorize(string moduleName, string controllerName, string actionName)
        {
            var moduleModel = new ModuleModel();
            var module      = moduleModel.GetSpecificModule(moduleName);

            var controller = module.Module_Controllers.First(x => x.Module_Controller_Name.Equals(controllerName));
            var action     = controller.Module_Actions.First(x => x.Module_Action_Name.Equals(actionName));

            if (action.Roles.Any())
            {
                Roles = string.Join(",", action.Roles.Select(r => r.Description).ToArray());
            }
        }