示例#1
0
 public UserAppService(IUserRepository repository, OrganizationUnitManager organizationUnitManager, RoleManager roleManager, PermissionInfoManager permissionInfoManager, UserManager userManager) : base(repository)
 {
     _organizationUnitManager = organizationUnitManager;
     _roleManager             = roleManager;
     _permissionInfoManager   = permissionInfoManager;
     _userManager             = userManager;
 }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="accountUnitRepository"></param>
 /// <param name="accountCache"></param>
 /// <param name="customAppSession"></param>
 /// <param name="jobUnitRepository"></param>
 /// <param name="divisionCache"></param>
 /// <param name="bankAccountUnitRepository"></param>
 /// <param name="bankAccountCache"></param>
 /// <param name="creditCardUnitRepository"></param>
 /// <param name="organizationExtendedRepository"></param>
 /// <param name="userOrganizationUnitRepository"></param>
 /// <param name="organizationExtendedUnitManager"></param>
 /// <param name="userManager"></param>
 /// <param name="organizationUnitRepository"></param>
 /// <param name="organizationUnitManager"></param>
 public UserSecuritySettingsAppService(
     IRepository <AccountUnit, long> accountUnitRepository,
     IAccountCache accountCache,
     CustomAppSession customAppSession,
     IRepository <JobUnit, int> jobUnitRepository,
     IDivisionCache divisionCache,
     IRepository <BankAccountUnit, long> bankAccountUnitRepository,
     IBankAccountCache bankAccountCache,
     IRepository <ChargeEntryDocumentUnit, long> creditCardUnitRepository,
     IRepository <OrganizationExtended, long> organizationExtendedRepository,
     IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
     OrganizationExtendedUnitManager organizationExtendedUnitManager,
     UserManager userManager,
     IRepository <OrganizationUnit, long> organizationUnitRepository,
     OrganizationUnitManager organizationUnitManager
     )
 {
     _accountUnitRepository           = accountUnitRepository;
     _accountCache                    = accountCache;
     _customAppSession                = customAppSession;
     _jobUnitRepository               = jobUnitRepository;
     _divisionCache                   = divisionCache;
     _bankAccountUnitRepository       = bankAccountUnitRepository;
     _bankAccountCache                = bankAccountCache;
     _creditCardUnitRepository        = creditCardUnitRepository;
     _organizationExtendedRepository  = organizationExtendedRepository;
     _userOrganizationUnitRepository  = userOrganizationUnitRepository;
     _organizationExtendedUnitManager = organizationExtendedUnitManager;
     _organizationUnitRepository      = organizationUnitRepository;
     _userManager             = userManager;
     _organizationUnitManager = organizationUnitManager;
 }
 public IdentityRoleAppService(
     IIdentityRoleRepository roleRepository,
     OrganizationUnitManager organizationUnitManager)
 {
     OrganizationUnitManager = organizationUnitManager;
     IdentityRoleRepository  = roleRepository;
 }
        private async Task UpdatePositionAsync(OrganizationUnit organizationUnit, List <OrganizationUnit> children, Guid?beforeOrganizationUnitId)
        {
            await RepairPosition(children);

            int newPosition = 1;

            if (beforeOrganizationUnitId.HasValue)
            {
                var beforeOrganizationUnit = children.Single(ou => ou.Id == beforeOrganizationUnitId.Value);
                newPosition = beforeOrganizationUnit.GetProperty <int>(OrganizationUnitExtraPropertyNames.PositionName) + 1;
            }

            foreach (var ou in children)
            {
                if (ou.GetProperty <int>(OrganizationUnitExtraPropertyNames.PositionName) >= newPosition &&
                    ou.Id != organizationUnit.Id
                    )
                {
                    ou.SetProperty(OrganizationUnitExtraPropertyNames.PositionName,
                                   ou.GetProperty <int>(OrganizationUnitExtraPropertyNames.PositionName) + 1);
                    await OrganizationUnitManager.UpdateAsync(ou);
                }
            }

            organizationUnit.SetProperty(OrganizationUnitExtraPropertyNames.PositionName, newPosition);
            await OrganizationUnitManager.UpdateAsync(organizationUnit);
        }
 public AbpIdentityTestDataBuilder(
     IGuidGenerator guidGenerator,
     IIdentityUserRepository userRepository,
     IdentityUserManager userManager,
     IIdentityClaimTypeRepository identityClaimTypeRepository,
     IIdentityRoleRepository roleRepository,
     IOrganizationUnitRepository organizationUnitRepository,
     IIdentitySecurityLogRepository identitySecurityLogRepository,
     ILookupNormalizer lookupNormalizer,
     IdentityTestData testData,
     OrganizationUnitManager organizationUnitManager,
     IIdentityLinkUserRepository identityLinkUserRepository,
     IdentityLinkUserManager identityLinkUserManager)
 {
     _guidGenerator  = guidGenerator;
     _userRepository = userRepository;
     _userManager    = userManager;
     _identityClaimTypeRepository = identityClaimTypeRepository;
     _roleRepository                = roleRepository;
     _lookupNormalizer              = lookupNormalizer;
     _testData                      = testData;
     _organizationUnitRepository    = organizationUnitRepository;
     _organizationUnitManager       = organizationUnitManager;
     _identityLinkUserRepository    = identityLinkUserRepository;
     _identityLinkUserManager       = identityLinkUserManager;
     _identitySecurityLogRepository = identitySecurityLogRepository;
 }
 public OperationApiAppService(
     ITenantAppService tenantAppService,
     TenantManager tenantManager,
     IFeatureManager featureManager,
     IRepository <EditionFeatureSetting, long> editionFeatureRepository,
     ILocalizationManager localizationManager,
     IIocManager iocManager,
     IAuthorizationConfiguration authorizationConfiguration,
     RoleManager roleManager,
     UserManager userManager,
     IRepository <User, long> userRepository,
     IRepository <OrganizationUnit, long> orgUnitRepository,
     OrganizationUnitManager organizationUnitManager)
 {
     _tenantAppService         = tenantAppService;
     _tenantManager            = tenantManager;
     _featureManager           = featureManager;
     _editionFeatureRepository = editionFeatureRepository;
     _localizationManager      = localizationManager;
     _iocManager = iocManager;
     _authorizationConfiguration = authorizationConfiguration;
     _roleManager             = roleManager;
     _userManager             = userManager;
     _userRepository          = userRepository;
     _orgUnitRepository       = orgUnitRepository;
     _organizationUnitManager = organizationUnitManager;
 }
        public virtual async Task MoveAsync(Guid id, OrganizationUnitMoveInput input)
        {
            var ou = await OrganizationUnitRepository.GetAsync(id, false);

            await AuthorizationService.CheckAsync(ou, CommonOperations.Update);

            if (input.ParentId != ou.ParentId)
            {
                if (input.ParentId.HasValue)
                {
                    var parentOrganizationUnit = await OrganizationUnitRepository.GetAsync(input.ParentId.Value, false);

                    await AuthorizationService.CheckAsync(parentOrganizationUnit, CommonOperations.Create);
                }
                else
                {
                    await AuthorizationService.CheckAsync(null, CommonOperations.Create);
                }
            }

            await OrganizationUnitManager.MoveAsync(ou.Id, input.ParentId);

            var children = await OrganizationUnitRepository.GetChildrenAsync(input.ParentId, false);

            await UpdatePositionAsync(ou, children, input.BeforeOrganizationUnitId);
        }
示例#8
0
        public virtual async Task <ListResultDto <OrganizationUnitDto> > GetRootAsync()
        {
            var rootOriganizationUnits = await OrganizationUnitManager.FindChildrenAsync(null, recursive : false);

            return(new ListResultDto <OrganizationUnitDto>(
                       ObjectMapper.Map <List <OrganizationUnit>, List <OrganizationUnitDto> >(rootOriganizationUnits)));
        }
        public virtual async Task <OrganizationUnitDto> UpdateAsync(Guid id, OrganizationUnitUpdateDto input)
        {
            var ou = await OrganizationUnitRepository.GetAsync(id, true);

            await AuthorizationService.CheckAsync(ou, CommonOperations.Update);

            ou.DisplayName      = input.DisplayName;
            ou.ConcurrencyStamp = input.ConcurrencyStamp;
            ou.SetProperty(OrganizationUnitExtraPropertyNames.IsActiveName, input.IsActive);

            foreach (var roleId in ou.Roles.Select(our => our.RoleId).Except(input.RoleIds))
            {
                ou.RemoveRole(roleId);
            }
            foreach (var roleId in input.RoleIds.Except(ou.Roles.Select(our => our.RoleId)))
            {
                ou.AddRole(roleId);
            }

            await OrganizationUnitManager.UpdateAsync(ou);

            //remove cache
            await CacheOrganizationUnits.RemoveAsync(AllOrganizationUnitsListCacheName);

            return(ObjectMapper.Map <OrganizationUnit, OrganizationUnitDto>(ou));
        }
 public OrganizationUnitAppService(
     OrganizationUnitManager organizationUnitManager,
     IRepository <OrganizationUnit, long> organizationUnitRepository,
     IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
     IRepository <Organization, long> organizationRepository,
     IRepository <UserRole, long> userRoleRepository,
     IRepository <Role, int> roleRepository,
     // IRepository<UserUnits, long> userUnitsRepository,
     IPoolAppService poolService,
     IQYWechatAppService iQYWechatAppService,
     IWechatAppService iWechatAppService,
     ISessionAppService sessionAppService
     )
 {
     _organizationUnitManager        = organizationUnitManager;
     _organizationUnitRepository     = organizationUnitRepository;
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
     _organizationRepository         = organizationRepository;
     _userRoleRepository             = userRoleRepository;
     _roleRepository = roleRepository;
     //  _userUnitsRepository = userUnitsRepository;
     _poolService         = poolService;
     _iQYWechatAppService = iQYWechatAppService;
     _iWechatAppService   = iWechatAppService;
     _sessionAppService   = sessionAppService;
 }
示例#11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public SynchronizeManager(
     IRepository <AbpOrganizationUnitExtend, long> organizationUnitRepository,
     IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
     IRepository <BaseUserOrg, int> baseOrgRepository,
     IRepository <BaseUserEmpOrg, int> baseEmpOrgRepository,
     IRepository <BaseUserEmp, long> baseUserRepository,
     OrganizationUnitManager organizationUnitManager,
     IRepository <User, long> userRepository,
     IRepository <UserLogin, long> userLoginRepository,
     IRepository <Role, int> roleRepository,
     IRepository <UserRole, long> userRoleRepository,
     IUnitOfWorkManager unitOfWorkManager,
     IAbpWeChatManager weChatManager,
     IPasswordHasher <User> passwordHasher,
     QYEmailManager emailManager
     )
 {
     _organizationUnitRepository     = organizationUnitRepository;
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
     _baseOrgRepository       = baseOrgRepository;
     _baseEmpOrgRepository    = baseEmpOrgRepository;
     _baseUserRepository      = baseUserRepository;
     _organizationUnitManager = organizationUnitManager;
     _userRepository          = userRepository;
     _userLoginRepository     = userLoginRepository;
     _roleRepository          = roleRepository;
     _userRoleRepository      = userRoleRepository;
     _passwordHasher          = passwordHasher;
     _unitOfWorkManager       = unitOfWorkManager;
     AbpSession     = NullAbpSession.Instance;
     _logger        = NullLogger.Instance;
     _weChatManager = weChatManager;
     _emailManager  = emailManager;
 }
示例#12
0
        public virtual async Task <ListResultDto <OrganizationUnitDto> > FindChildrenAsync(OrganizationUnitGetChildrenDto input)
        {
            var origanizationUnitChildren = await OrganizationUnitManager.FindChildrenAsync(input.Id, input.Recursive);

            return(new ListResultDto <OrganizationUnitDto>(
                       ObjectMapper.Map <List <OrganizationUnit>, List <OrganizationUnitDto> >(origanizationUnitChildren)));
        }
 public ReceiveSyncAppService(
     IAbpWeChatManager weChatManager
     , IRepository <User, long> userRepository
     , IRepository <UserLogin, long> userLoginRepository
     , IPasswordHasher <User> passwordHasher
     , IRepository <AbpOrganizationUnitExtend, long> organizationUnitRepository
     , IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository
     , OrganizationUnitManager organizationUnitManager
     , IRepository <Role, int> roleRepository
     , IRepository <UserRole, long> userRoleRepository
     , IRepository <BaseUserEmp, long> baseUserRepository
     , IRepository <BaseUserOrg, int> baseOrgRepository
     , IRepository <BaseUserEmpOrg, int> baseEmpOrgRepository
     , IRepository <BaseUserRole, int> baseRoleRepository)
 {
     _weChatManager                  = weChatManager;
     _userRepository                 = userRepository;
     _userLoginRepository            = userLoginRepository;
     _passwordHasher                 = passwordHasher;
     _organizationUnitRepository     = organizationUnitRepository;
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
     _organizationUnitManager        = organizationUnitManager;
     _roleRepository                 = roleRepository;
     _userRoleRepository             = userRoleRepository;
     _baseUserRepository             = baseUserRepository;
     _baseOrgRepository              = baseOrgRepository;
     _baseEmpOrgRepository           = baseEmpOrgRepository;
     _baseRoleRepository             = baseRoleRepository;
 }
        public virtual async Task DeleteAsync(Guid id)
        {
            var ou = await OrganizationUnitRepository.GetAsync(id, false);

            await AuthorizationService.CheckAsync(ou, CommonOperations.Delete);

            await OrganizationUnitManager.DeleteAsync(ou.Id);
        }
示例#15
0
 public OrganizationUnitAppService(
     IRepository <OrganizationUnit, long> entityRepository
     , OrganizationUnitManager entityManager
     )
 {
     _entityRepository = entityRepository;
     _entityManager    = entityManager;
 }
示例#16
0
 public WzhIdentityRoleAppService(IdentityRoleManager roleManager,
                                  IIdentityRoleRepository roleRepository,
                                  IStringLocalizer <AbpVnextResource> localizer,
                                  OrganizationUnitManager orgManager) : base(roleManager, roleRepository)
 {
     _localizer = localizer;
     OrgManager = orgManager;
 }
        //public DefaultTencentCloudBlobNameCalculator(ICurrentTenant currentTenant)
        // {

        public CreateModalModel(
            IOrganizationUnitAppService bookAppService, OrganizationUnitManager organizationUnitManager, ITenantAppService tenantAppService, ICurrentTenant currentTenant)
        {
            _bookAppService          = bookAppService;
            _tenantAppService        = tenantAppService;
            _currentTenant           = currentTenant;
            _organizationUnitManager = organizationUnitManager;
        }
示例#18
0
 public TenantDemoDataBuilder(OrganizationUnitManager organizationUnitManager, UserManager userManager, RandomUserGenerator randomUserGenerator, IBinaryObjectManager binaryObjectManager, IAppFolders appFolders)
 {
     this._organizationUnitManager = organizationUnitManager;
     this._userManager             = userManager;
     this._randomUserGenerator     = randomUserGenerator;
     this._binaryObjectManager     = binaryObjectManager;
     this._appFolders = appFolders;
 }
 public OrganizationUnitAppService(
     IRepository <OrganizationUnit, long> repository,
     IRepository <UserOrganizationUnit, long> userOrgRepository,
     OrganizationUnitManager organizationUnitManager) : base(repository)
 {
     _organizationUnitManager = organizationUnitManager;
     _userOrgRepository       = userOrgRepository;
 }
 public OrganizationUnitAppService(IIdentityUserRepository userRepository, IdentityUserManager userManager, IIdentityRoleRepository roleRepository, OrganizationUnitManager organizationUnitManager, IOrganizationUnitRepository organizationUnitRepository, IDistributedCache <List <OrganizationUnit> > cacheOrganizationUnits)
 {
     UserRepository             = userRepository;
     UserManager                = userManager;
     RoleRepository             = roleRepository;
     OrganizationUnitManager    = organizationUnitManager;
     OrganizationUnitRepository = organizationUnitRepository;
     CacheOrganizationUnits     = cacheOrganizationUnits;
 }
示例#21
0
 public OrganizationUnitAppService(IOrganizationUnitRepository repository, OrganizationUnitManager organizationUnitManager) : base(repository)
 {
     CreatePermissionName     = PermissionNames.Pages_OrganizationUnits_Create;
     UpdatePermissionName     = PermissionNames.Pages_OrganizationUnits_Update;
     DeletePermissionName     = PermissionNames.Pages_OrganizationUnits_Delete;
     GetAllPermissionName     = PermissionNames.Pages_OrganizationUnits_GetAll;
     GetPermissionName        = PermissionNames.Pages_OrganizationUnits_GetAll;
     _organizationUnitManager = organizationUnitManager;
 }
示例#22
0
 public TigerIdentityRoleAppService(IdentityRoleManager roleManager,
                                    IIdentityRoleRepository roleRepository,
                                    //IStringLocalizer<HelloAbpResource> localizer,
                                    OrganizationUnitManager orgManager) : base(roleManager, roleRepository)
 {
     //_localizer = localizer;
     _orgManager  = orgManager;
     _roleManager = roleManager;
 }
示例#23
0
 public TestOrganizationUnitDataBuilder(IGuidGenerator guidGenerator,
                                        OrganizationUnitManager organizationUnitManager, IOrganizationUnitRepository organizationUnitRepository,
                                        ProductManager productManager)
 {
     _guidGenerator              = guidGenerator;
     _organizationUnitManager    = organizationUnitManager;
     _organizationUnitRepository = organizationUnitRepository;
     _productManager             = productManager;
 }
 public OrganizationUnitAppService(
     OrganizationUnitManager organizationUnitManager,
     IRepository <OrganizationUnit, long> organizationUnitRepository,
     IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository)
 {
     _organizationUnitManager        = organizationUnitManager;
     _organizationUnitRepository     = organizationUnitRepository;
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
 }
示例#25
0
 public OrganizationUnitAppService(OrganizationUnitManager organizationUnitManager, IRepository <OrganizationUnit, long> organizationUnitRepository, IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository, IRepository <OrganizationUnitProperties, long> organizationUnitPropertiesRepository, IRepository <Customer, long> customerRepository, FuelWerx.Authorization.Users.UserManager userManager)
 {
     this._organizationUnitManager              = organizationUnitManager;
     this._organizationUnitRepository           = organizationUnitRepository;
     this._userOrganizationUnitRepository       = userOrganizationUnitRepository;
     this._organizationUnitPropertiesRepository = organizationUnitPropertiesRepository;
     this._customerRepository = customerRepository;
     this._userManager        = userManager;
 }
示例#26
0
        //private readonly UserOrganizationUnitManager _entityManager;

        public OrganizationUnitDgAppService(
            IRepository <OrganizationUnit, long> entityRepository
            , OrganizationUnitManager organizationUnitManager
            , UserOrganizationUnitDgManager <TRole, TUser> entityManager
            )
        {
            _entityRepository        = entityRepository;
            _organizationUnitManager = organizationUnitManager;
            _entityManager           = entityManager;
        }
示例#27
0
 public BroadbandAppService(IRepository <BroadbandUser> userUepository,
                            OrganizationUnitManager organizationUnitManager,
                            IRepository <BroadbandWarn> warnRepository,
                            IOrganizationUnitCache organizationUnitCache)
 {
     _userRepository          = userUepository;
     _organizationUnitManager = organizationUnitManager;
     _warnRepository          = warnRepository;
     _organizationUnitCache   = organizationUnitCache;
 }
示例#28
0
        public virtual async Task DeleteAsync(Guid id)
        {
            var origanizationUnit = await OrganizationUnitRepository.FindAsync(id);

            if (origanizationUnit == null)
            {
                return;
            }
            await OrganizationUnitManager.DeleteAsync(id);
        }
示例#29
0
 public OrganizationUnitManager_Tests()
 {
     _organizationUnitManager    = GetRequiredService <OrganizationUnitManager>();
     _organizationUnitRepository = GetRequiredService <IOrganizationUnitRepository>();
     _identityRoleRepository     = GetRequiredService <IIdentityRoleRepository>();
     _lookupNormalizer           = GetRequiredService <ILookupNormalizer>();
     _testData          = GetRequiredService <IdentityTestData>();
     _unitOfWorkManager = GetRequiredService <IUnitOfWorkManager>();
     _guidGenerator     = GetService <IGuidGenerator>();
 }
示例#30
0
 public MdasAppService(
     IRepository <Mda, long> mdaRepository,
     IRepository <User, long> lookup_userRepository,
     IRepository <OrganizationUnit, long> lookup_organizationUnitRepository,
     OrganizationUnitManager organizationUnitManager)
 {
     _mdaRepository                     = mdaRepository;
     _lookup_userRepository             = lookup_userRepository;
     _lookup_organizationUnitRepository = lookup_organizationUnitRepository;
     _organizationUnitManager           = organizationUnitManager;
 }