public override Task <UserDto> Update(UserDto input) { input.EName = PinYinUtil.GetAllPinYin(input.Name); input.SName = PinYinUtil.GetSimplePinYin(input.Name); _userManager.SetOrganizationUnit(input.Id, input.OrganIds); _userManager.SetRole(input.Id, input.RoleIds); _userManager.SetPermission(input.Id, input.PersIds); return(base.Update(input)); }
public override Task <UserDto> Create(CreateUserDto input) { input.EName = PinYinUtil.GetAllPinYin(input.Name); input.SName = PinYinUtil.GetSimplePinYin(input.Name); input.Password = GetEncrpyedAccessToken(input.Password); _userManager.SetOrganizationUnit(input.Id, input.OrganIds); _userManager.SetRole(input.Id, input.RoleIds); _userManager.SetPermission(input.Id, input.PersIds); return(base.Create(input)); }
public override Task <UserDto> Update(UserDto input) { CheckUpdatePermission(); input.EName = PinYinUtil.GetAllPinYin(input.Name); input.SName = PinYinUtil.GetSimplePinYin(input.Name); if (IsGranted(PermissionNames.Pages_Users_SetOrgan)) { _userManager.SetOrganizationUnit(input.Id, input.OrganIds); } if (IsGranted(PermissionNames.Pages_Users_SetRole)) { _userManager.SetRole(input.Id, input.RoleIds); } if (IsGranted(PermissionNames.Pages_Users_SetPers)) { _userManager.SetPermission(input.Id, input.PersIds); } return(base.Update(input)); }
public override Task <UserDto> Create(CreateUserDto input) { CheckCreatePermission(); input.EName = PinYinUtil.GetAllPinYin(input.Name); input.SName = PinYinUtil.GetSimplePinYin(input.Name); input.Password = GetEncrpyedAccessToken(input.Password); if (IsGranted(PermissionNames.Pages_Users_SetOrgan)) { _userManager.SetOrganizationUnit(input.Id, input.OrganIds); } if (IsGranted(PermissionNames.Pages_Users_SetRole)) { _userManager.SetRole(input.Id, input.RoleIds); } if (IsGranted(PermissionNames.Pages_Users_SetPers)) { _userManager.SetPermission(input.Id, input.PersIds); } return(base.Create(input)); }