예제 #1
0
        public JsonResult ListRoles(String RoleName)
        {
            String[] roles = Roles.GetAllRoles();
            AuthenticationsAndAuthorizationsOperations authenNAuthorOps = new AuthenticationsAndAuthorizationsOperations();
            List <RoleViewModel> listRoles = new List <RoleViewModel>();

            foreach (String role in roles)
            {
                listRoles.Add(new RoleViewModel {
                    NewRoleName = role,
                    OldRoleName = role,
                    Description = authenNAuthorOps.GetRoleDescByRoleName(role)
                });
            }
            return(Json(new { Total = listRoles.Count, Data = listRoles }));
        }
예제 #2
0
        public ActionResult EditRole(String roleName)
        {
            String[]      roles         = Roles.GetAllRoles();
            RoleViewModel roleViewModel = new RoleViewModel();
            AuthenticationsAndAuthorizationsOperations anaOps = new AuthenticationsAndAuthorizationsOperations();

            foreach (String role in roles)
            {
                if (role == roleName)
                {
                    roleViewModel.OldRoleName = role;
                    roleViewModel.NewRoleName = role;
                    roleViewModel.Description = anaOps.GetRoleDescByRoleName(roleName);
                }
            }
            return(View(roleViewModel));
        }