Exemple #1
0
        public virtual async Task RemoveFromOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)
        {
            await IdentityUserRepository.EnsureCollectionLoadedAsync(user, u => u.OrganizationUnits, CancellationTokenProvider.Token);

            user.RemoveOrganizationUnit(ou.Id);
        }
Exemple #2
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));
        }
Exemple #3
0
 public virtual Task RemoveRoleFromOrganizationUnitAsync(IdentityRole role, OrganizationUnit organizationUnit)
 {
     organizationUnit.RemoveRole(role.Id);
     return(Task.FromResult(0));
 }
Exemple #4
0
        public virtual async Task UpdateAsync(OrganizationUnit organizationUnit)
        {
            await ValidateOrganizationUnitAsync(organizationUnit);

            await OrganizationUnitRepository.UpdateAsync(organizationUnit);
        }
Exemple #5
0
 public virtual Task <bool> IsInOrganizationUnitAsync(IdentityUser user, OrganizationUnit ou)
 {
     return(Task.FromResult(user.IsInOrganizationUnit(ou.Id)));
 }