public virtual async Task SetOrganizationUnitsAsync(Guid userId, params Guid[] organizationUnitIds) { await SetOrganizationUnitsAsync( await IdentityUserRepository.GetAsync(userId, cancellationToken: CancellationToken), organizationUnitIds ); }
public virtual async Task AddToOrganizationUnitAsync(Guid userId, Guid ouId) { await AddToOrganizationUnitAsync( await IdentityUserRepository.GetAsync(userId, cancellationToken: CancellationToken), await OrganizationUnitRepository.GetAsync(ouId, cancellationToken: CancellationToken) ); }
public async Task <AppUserDto> GetCurrentUserAsync() { var userId = CurrentUser.Id ?? throw new BusinessException(); var userE = await IdentityUserRepository.GetAsync(userId); return(ObjectMapper.Map <Volo.Abp.Identity.IdentityUser, AppUserDto>(userE)); }
public virtual async Task RemoveFromOrganizationUnitAsync(Guid userId, Guid ouId) { var user = await IdentityUserRepository.GetAsync(userId, cancellationToken : CancellationToken); user.RemoveOrganizationUnit(ouId); }
public virtual async Task <bool> IsInOrganizationUnitAsync(Guid userId, Guid ouId) { var user = await IdentityUserRepository.GetAsync(userId, cancellationToken : CancellationToken); return(user.IsInOrganizationUnit(ouId)); }
public async Task <AppUserDto> GetAsync(Guid userId) { var userE = await IdentityUserRepository.GetAsync(userId); return(ObjectMapper.Map <Volo.Abp.Identity.IdentityUser, AppUserDto>(userE)); }