Esempio n. 1
0
 public virtual Task RemoveRoleFromOrganizationUnitAsync(IdentityRole role, OrganizationUnit organizationUnit)
 {
     organizationUnit.RemoveRole(role.Id);
     return(OrganizationUnitRepository.UpdateAsync(organizationUnit));
 }
Esempio n. 2
0
        public virtual async Task UpdateAsync(OrganizationUnit organizationUnit)
        {
            await ValidateOrganizationUnitAsync(organizationUnit);

            await OrganizationUnitRepository.UpdateAsync(organizationUnit);
        }
Esempio n. 3
0
 public virtual Task <bool> IsInOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)
 {
     return(Task.FromResult(user.IsInOrganizationUnit(ou.Id)));
 }
Esempio n. 4
0
        public virtual async Task RemoveFromOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)
        {
            await IdentityUserRepository.EnsureCollectionLoadedAsync(user, u => u.OrganizationUnits, CancellationTokenProvider.Token);

            user.RemoveOrganizationUnit(ou.Id);
        }
Esempio n. 5
0
        public virtual async Task <bool> IsInOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)
        {
            await IdentityUserRepository.EnsureCollectionLoadedAsync(user, u => u.OrganizationUnits, CancellationTokenProvider.Token);

            return(user.IsInOrganizationUnit(ou.Id));
        }
Esempio n. 6
0
 public virtual Task RemoveRoleFromOrganizationUnitAsync(IdentityRole role, OrganizationUnit organizationUnit)
 {
     organizationUnit.RemoveRole(role.Id);
     return(Task.FromResult(0));
 }
Esempio n. 7
0
 public async Task GetAllChildrenWithParentCodeAsync()
 {
     (await _organizationUnitRepository.GetAllChildrenWithParentCodeAsync(OrganizationUnit.CreateCode(0),
                                                                          _guidGenerator.Create())).ShouldNotBeNull();
 }