Beispiel #1
0
        private void AddUserRole(PUser user, string roleLogicalName)
        {
            PRole role = _roleService.GetRoleByLogicalName(roleLogicalName);

            if (role == null)
            {
                throw new Exception();
            }

            _userRolesService.Add(new PUserRole()
            {
                Role = role, User = user
            });
        }
Beispiel #2
0
        public async Task <ActionResult> Add(AddUserToRoleInputDto model)
        {
            await userRolesServices.Add(model);

            return(Ok());
        }