示例#1
0
 public virtual async Task SetOrganizationUnitsAsync(Guid userId, params Guid[] organizationUnitIds)
 {
     await SetOrganizationUnitsAsync(
         await IdentityUserRepository.GetAsync(userId, cancellationToken: CancellationToken),
         organizationUnitIds
         );
 }
示例#2
0
 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));
        }
示例#4
0
        public virtual async Task RemoveFromOrganizationUnitAsync(Guid userId, Guid ouId)
        {
            var user = await IdentityUserRepository.GetAsync(userId, cancellationToken : CancellationToken);

            user.RemoveOrganizationUnit(ouId);
        }
示例#5
0
        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));
        }