Here you go:
[AbpAuthorize(AppPermissions.Pages_Administration_Users_Edit)]
protected virtual async Task UpdateUserAsync(CreateOrUpdateUserInput input)
{
Debug.Assert(input.User.Id != null, "input.User.Id should be set.");
var user = await UserManager.FindByIdAsync(input.User.Id.Value);
//Update user properties
input.User.MapTo(user); //Passwords is not mapped (see mapping configuration)
if (input.SetRandomPassword)
{
input.User.Password = User.CreateRandomPassword();
}
if (!input.User.Password.IsNullOrEmpty())
{
CheckErrors(await UserManager.ChangePasswordAsync(user, input.User.Password));
}
CheckErrors(await UserManager.UpdateAsync(user));
//Update roles
CheckErrors(await UserManager.SetRoles(user, input.AssignedRoleNames));
if (input.SendActivationEmail)
{
user.SetNewEmailConfirmationCode();
await _userEmailer.SendEmailActivationLinkAsync(user, input.User.Password);
}
}
Hi, I read in the documentation that it is recommended to make use of SetTenantId instead of DisableFilter.
Regards Bilal
Thanks!
I can inject LocalizationSource in my classes?
Thanks
Thanks :)
Given the illustration above to handle certain events is it okay to make use of those events to run my own code? For instance I need to create 4 roles or groups when an OU is created. Is there a better way or using events is better?
Thanks
Sometimes it's the only method call.
I know how it feels when one is stuck and needs some help! We should all of us start helping each other more here on the forums.
Thanks Ismail for your efforts always.
Bilal
Thanks. But existing code of ABP Framework does it in more than places, so I got confused.