예제 #1
0
 public AccessService(IPermissionResolverService permissionResolverService, UserService userService, IGroupStore groupStore, ILogger logger)
 {
     _permissionResolverService = permissionResolverService ?? throw new ArgumentNullException(nameof(permissionResolverService));
     _userService = userService ?? throw new ArgumentNullException(nameof(userService));
     _groupStore  = groupStore ?? throw new ArgumentNullException(nameof(groupStore));
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #2
0
        public async Task UpdateGroupAsync(GroupMemberDiff memberDiff, bool ignoreChangeLimit = false)
        {
            if (memberDiff is null)
            {
                throw new ArgumentNullException(nameof(memberDiff));
            }
            if (!ignoreChangeLimit && memberDiff.ChangeRatio < _changeRatioLowerLimit)
            {
                throw new ChangeRatioException();
            }
            IGroupStore store = GetGroupStore(memberDiff.Document);

            foreach (GroupMember member in memberDiff.Remove)
            {
                await store.RemoveGroupMemberAsync(member, memberDiff.Document.GroupId);

                await _logger?.StoreOperationalLogItemAsync(new OperationalLogItem(memberDiff.Document, GroupMemberOperations.Remove, member));
            }
            foreach (GroupMember member in memberDiff.Add)
            {
                await store.AddGroupMemberAsync(member, memberDiff.Document.GroupId);

                await _logger?.StoreOperationalLogItemAsync(new OperationalLogItem(memberDiff.Document, GroupMemberOperations.Add, member));
            }
        }
예제 #3
0
        public InviteService(
            IBaseDAO <AppUserEntity> userDAO,
            IBaseDAO <RoleEntity> roleDAO,
            IBaseDAO <InviteEntity> inviteDAO,
            IGroupStore groupStore,
            IGroupUserStore groupUserStore,
            IEmailService mailService,
            IAddInviteFilter addInviteFilter,
            IValidator <InviteToGroupRequest> inviteToGroupRequestValidator,
            IValidator <InviteRequest> inviteRequestValidator,
            ILogger <InviteService> logger,
            IOptions <IdentityUIOptions> identityManagementOptions,
            IOptions <IdentityUIEndpoints> identityManagementEndpoints)
        {
            _userDAO   = userDAO;
            _roleDAO   = roleDAO;
            _inviteDAO = inviteDAO;

            _groupStore      = groupStore;
            _groupUserStore  = groupUserStore;
            _mailService     = mailService;
            _addInviteFilter = addInviteFilter;

            _inviteToGroupRequestValidator = inviteToGroupRequestValidator;
            _inviteRequestValidator        = inviteRequestValidator;

            _logger = logger;

            _identityManagementOptions   = identityManagementOptions.Value;
            _identityManagementEndpoints = identityManagementEndpoints.Value;
        }
예제 #4
0
 public GroupMigratorService(
     IGroupStore groupStore,
     ILogger logger)
 {
     _groupStore = groupStore ?? throw new ArgumentNullException(nameof(groupStore));
     _logger     = logger;
 }
예제 #5
0
 public GroupRepository(IGroupStore store,
                        ICacheService cacheService,
                        IUserIdAccesor userIdAccesor,
                        ICacheOptions options)
     : base(store, cacheService, options)
 {
     _userIdAccesor = userIdAccesor;
 }
예제 #6
0
        private async Task <GroupMemberCollection> GetCurrentMembersAsync(GrouperDocument document)
        {
            var         memberCollection = new GroupMemberCollection();
            IGroupStore store            = GetGroupStore(document);
            await store.GetGroupMembersAsync(memberCollection, document.GroupId);

            return(memberCollection);
        }
예제 #7
0
 public GameHub(
     IGroupStore groupStore,
     IPlayerStore playerStore,
     IGameEngineService gameEngineService)
 {
     _groupStore        = groupStore ?? throw new ArgumentNullException(nameof(groupStore));
     _playerStore       = playerStore ?? throw new ArgumentNullException(nameof(playerStore));
     _gameEngineService = gameEngineService ?? throw new ArgumentNullException(nameof(gameEngineService));
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="store">The IGroupStore is responsible for commiting changes via the UpdateAsync/CreateAsync methods</param>
 public GroupManager(IGroupStore <TGroup, TKey> store)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     this.Store          = store;
     this.GroupValidator = new GroupValidator <TGroup, TKey>(this);
 }
예제 #9
0
 public TextController(ITextStore textStore,
                       IGroupStore groupStore,
                       IModelFactory modelFactory)
 {
     //_textTempDb = textTempDb;
     //_groupTempDb = groupTempDb;
     _textStore    = textStore;
     _groupStore   = groupStore;
     _modelFactory = modelFactory;
 }
예제 #10
0
        public GroupService(IBaseRepository <GroupEntity> groupRepository, IGroupStore groupStore,
                            IValidator <AddGroupRequest> addGroupValidator, ILogger <GroupService> logger)
        {
            _groupRepository = groupRepository;
            _groupStore      = groupStore;

            _addGroupValidator = addGroupValidator;

            _logger = logger;
        }
예제 #11
0
 public GroupController(ITextStore textStore,
                        IGroupStore groupStore,
                        IModelFactory modelFactory)
 {
     //_tempDbText = textTempDb;
     //_tempDbGroup = groupTempDb;
     //_analysisController = analysisController;
     _textStore    = textStore;
     _groupStore   = groupStore;
     _modelFactory = modelFactory;
 }
예제 #12
0
 public GroupService(
     IGroupStore groupStore,
     IRoleStore roleStore,
     IUserStore userStore,
     RoleService roleService)
 {
     _roleStore   = roleStore;
     _userStore   = userStore;
     _groupStore  = groupStore ?? throw new ArgumentNullException(nameof(groupStore));
     _roleService = roleService ?? throw new ArgumentNullException(nameof(roleService));
 }
예제 #13
0
        public GroupDataService(IBaseRepository <GroupEntity> groupRepository, IGroupStore groupStore, IGroupUserStore groupUserStore,
                                IValidator <DataTableRequest> dataTableValidator, ILogger <GroupDataService> logger)
        {
            _groupRepository = groupRepository;

            _groupUserStore = groupUserStore;
            _groupStore     = groupStore;

            _dataTableValidator = dataTableValidator;

            _logger = logger;
        }
예제 #14
0
 public Grouper AddGroupStore(IGroupStore groupStore)
 {
     foreach (GroupStores store in groupStore.GetSupportedGroupStores())
     {
         if (_groupStores.ContainsKey(store))
         {
             throw new ArgumentException($"A group store for {store} is already added.", nameof(groupStore));
         }
         _groupStores.Add(store, groupStore);
     }
     return(this);
 }
예제 #15
0
 public GroupsController(UserManager <User> userManager, SignInManager <User> signInManager, ApplicationDbContext _context,
                         IUserStore _userStore, IGroupStore _GroupStore, ILogger <GroupsController> _logger, IGroupRequestStore _GroupRequestStore,
                         INotificationBox _notificationBox)
 {
     this.userManager        = userManager;
     this.signInManager      = signInManager;
     this._context           = _context;
     this._userStore         = _userStore;
     this._GroupStore        = _GroupStore;
     this._logger            = _logger;
     this._GroupRequestStore = _GroupRequestStore;
     this._notificationBox   = _notificationBox;
 }
예제 #16
0
        public void Initialize()
        {
            _db           = new FingerprintLite13Entities();
            _modelFactory = new ModelFactory();
            _textStore    = new TextStore(_db, _modelFactory);
            _groupStore   = new GroupStore(_db, _modelFactory, _textStore);
            _uniqueNames  = new ConcurrentStack <string>();

            //Assuming we will never need more than 2 group names per method
            int namesNeeded = 2 * (this.GetType()).GetMethods().Count();

            GenerateNames(namesNeeded, _uniqueNames);
        }
예제 #17
0
        public GroupUserService(IBaseRepository <GroupUserEntity> groupUserRepository, IBaseRepository <AppUserEntity> userRepository,
                                IBaseRepository <RoleEntity> roleRepository, IGroupUserStore groupUserStore, IGroupStore groupStore,
                                IValidator <AddExistingUserRequest> addExistingUserValidator, ILogger <GroupUserService> logger)
        {
            _groupUserRepository = groupUserRepository;
            _userRepository      = userRepository;
            _roleRepository      = roleRepository;

            _groupUserStore = groupUserStore;
            _groupStore     = groupStore;

            _addExistingUserValidator = addExistingUserValidator;

            _logger = logger;
        }
예제 #18
0
 public GetUserProfileQuery(Guid Id, UserManager <User> UserManager,
                            IUserStore UserStore, IFriendsListStore FriendListStore, IRequestStore RequestStore,
                            IGroupStore GroupStore, ILogger <AccountsController> Logger,
                            UserAccount existingAccount, IdentityUser Currentuser)
 {
     this.AccountId   = Id;
     _UserManager     = UserManager;
     _UserStore       = UserStore;
     _FriendListStore = FriendListStore;
     _RequestStore    = RequestStore;
     _GroupStore      = GroupStore;
     _Logger          = Logger;
     _CurrentUser     = Currentuser;
     _ExistingAccount = existingAccount;
     _mapper          = new MapperConfiguration(cfg => cfg.AddProfile <EntityMapper>()).CreateMapper();
 }
예제 #19
0
 public AccountsController(UserManager <User> userManager, SignInManager <User> signInManager, ApplicationDbContext _context,
                           IUserStore _userStore, IFriendsListStore _FriendListStore, IRequestStore _RequestStore, INotificationBox _notificationBox,
                           IGroupStore GroupStore, ILogger <AccountsController> _logger, IAdminRequestStore _AdminRequestStore)
 {
     this.userManager        = userManager;
     this.signInManager      = signInManager;
     this._context           = _context;
     this._userStore         = _userStore;
     this._FriendListStore   = _FriendListStore;
     this._RequestStore      = _RequestStore;
     this._notificationBox   = _notificationBox;
     this.GroupStore         = GroupStore;
     this._logger            = _logger;
     this._AdminRequestStore = _AdminRequestStore;
     _mapper = new MapperConfiguration(cfg => cfg.AddProfile <EntityMapper>()).CreateMapper();
 }
예제 #20
0
        public GroupService(
            IBaseDAO <GroupEntity> groupDAO,
            IBaseDAO <InviteEntity> inviteDAO,
            IBaseDAO <GroupUserEntity> groupUserDAO,
            IGroupStore groupStore,
            IValidator <AddGroupRequest> addGroupValidator,
            IValidator <UpdateGroupModel> updateGroupModelValidator,
            ILogger <GroupService> logger)
        {
            _groupDAO     = groupDAO;
            _inviteDAO    = inviteDAO;
            _groupUserDAO = groupUserDAO;

            _groupStore = groupStore;

            _addGroupValidator         = addGroupValidator;
            _updateGroupModelValidator = updateGroupModelValidator;

            _logger = logger;
        }
예제 #21
0
        public InviteService(IBaseRepository <AppUserEntity> userRepository, IBaseRepository <InviteEntity> inviteRepository,
                             IBaseRepository <RoleEntity> roleRepository, IGroupStore groupStore, IGroupUserStore groupUserStore, IEmailService mailService,
                             IValidator <InviteToGroupRequest> inviteToGroupRequestValidator, IValidator <InviteRequest> inviteRequestValidator,
                             ILogger <InviteService> logger, IOptionsSnapshot <IdentityUIOptions> identityManagementOptions,
                             IOptionsSnapshot <IdentityUIEndpoints> identityManagementEndpoints)
        {
            _userRepository   = userRepository;
            _inviteRepository = inviteRepository;
            _roleRepository   = roleRepository;

            _groupStore     = groupStore;
            _groupUserStore = groupUserStore;

            _mailService = mailService;

            _inviteToGroupRequestValidator = inviteToGroupRequestValidator;
            _inviteRequestValidator        = inviteRequestValidator;

            _logger = logger;

            _identityManagementOptions   = identityManagementOptions.Value;
            _identityManagementEndpoints = identityManagementEndpoints.Value;
        }
예제 #22
0
 public DefaultGroups(IGroupStore groupStore)
 {
     _groupStore = groupStore;
     _dictionary = new ConcurrentDictionary <string, Group>();
 }
 public ApplicationGroupManager(IGroupStore <ApplicationGroup> groupStore)
     : base(groupStore)
 {
 }
예제 #24
0
        public async Task <GroupInfo> GetGroupInfoAsync(GrouperDocument document)
        {
            IGroupStore store = GetGroupStore(document);

            return(await store.GetGroupInfoAsync(document.GroupId));
        }
		public ApplicationGroupManager(IGroupStore<ApplicationGroup> store)
		{
			_groupStore = store;
		}
예제 #26
0
 public GroupService(IGroupStore groupStore, ILogger <GroupService> logger)
 {
     _groupStore = groupStore;
     _logger     = logger;
 }
예제 #27
0
 public DefaultEntities(IGroupStore groupStore)
 {
     _groups = new DefaultGroups(groupStore);
 }
예제 #28
0
 public GroupService(IGroupStore groupStore)
 {
     _groupStore = groupStore;
 }
예제 #29
0
 public GroupAdminSettingsDataService(IGroupStore groupStore, ILogger <GroupAdminSettingsDetailsModel> logger)
 {
     _groupStore = groupStore;
     _logger     = logger;
 }
예제 #30
0
 /// <summary>Initializes a new instance of the <see cref="GroupsController"/> class.</summary>
 /// <param name="store">The store used to get groups defined in the <c>/etc/group</c> file.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="store"/> is <c>null</c>.</exception>
 public GroupsController(IGroupStore store) =>
 this.store = store ?? throw new ArgumentNullException(nameof(store));