Exemplo n.º 1
0
        public IActionResult ResourcePermissionTypeActions(int id, List <SelectableViewModel <ResourcePermissionTypeActionViewModel> > selectablePermissions)
        {
            var permissionsIds = GetSelectedItems(selectablePermissions).Select(x => x.Id);

            var result = m_rolesManager.AssignResourcePermissionTypeActionsToRole(id, permissionsIds);

            if (result.HasError)
            {
                ModelState.AddModelError(result.Error.Message);

                var viewModel = ViewModelBuilder.BuildRoleResourcePermissionTypeActionsViewModel(ModelState, id);

                return(View(viewModel));
            }

            return(RedirectToAction(nameof(View), new { id = id }));
        }
Exemplo n.º 2
0
        public IActionResult ResourcePermissionTypeActions(int id)
        {
            var viewModel = ViewModelBuilder.BuildRoleResourcePermissionTypeActionsViewModel(ModelState, id);

            return(View(viewModel));
        }