コード例 #1
0
        public void RemoveUserAccount(Guid userId, AccountType type, string name)
        {
            userContext.CheckPermission(Permissions.UserMaintenance);

            var command = new RemoveUserAccountCommand(userId, type, name);

            commandBus.Value.Send(Envelope.Create(command));
        }
コード例 #2
0
        public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable<string> authenticatedGroups, 
            IEnumerable<KeyValuePair<string, string>> customProperties)
        {
            Guid userId = Guid.NewGuid();
            var properties = customProperties != null ? customProperties.ToList() : null;
            var createUserCommand = new CreateUserCommand(userId, displayName, properties);
            commandBus.Value.Send(Envelope.Create(createUserCommand));

            var createAccountCommand = new CreateExternalUserAccountCommand(userId, type, accountName);
            commandBus.Value.Send(Envelope.Create(createAccountCommand));

            SetRolesAndGroups(userId, authenticatedGroups);

            return userId;
        }
コード例 #3
0
        public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable <string> authenticatedGroups,
                            IEnumerable <KeyValuePair <string, string> > customProperties)
        {
            Guid userId     = Guid.NewGuid();
            var  properties = customProperties != null?customProperties.ToList() : null;

            var createUserCommand = new CreateUserCommand(userId, displayName, properties);

            commandBus.Value.Send(Envelope.Create(createUserCommand));

            var createAccountCommand = new CreateExternalUserAccountCommand(userId, type, accountName);

            commandBus.Value.Send(Envelope.Create(createAccountCommand));

            SetRolesAndGroups(userId, authenticatedGroups);

            return(userId);
        }
コード例 #4
0
        public IEnumerable <IUser> GetUsers(string customPropertyName, string customPropertyValue, AccountType accountType)
        {
            var mapper = new UserMapper();

            return(mapper.Map(queryService.GetUsers(customPropertyName, customPropertyValue, (Querying.Data.AccountType)accountType)));
        }
コード例 #5
0
        public bool IsExistingUserAccount(string accountName, AccountType type)
        {
            userContext.CheckPermission(Permissions.UserMaintenance);

            return(queryService.IsExistingUser(accountName, (Querying.Data.AccountType)type));
        }
コード例 #6
0
        public void UpdateUserGroupsAndRoles(string accountName, AccountType accountType, IEnumerable<string> authenticatedGroups)
        {
            Guid userId = GetUser(accountName, accountType).Id;

            SetRolesAndGroups(userId, authenticatedGroups);
        }
コード例 #7
0
 public bool IsExistingUserAccount(string accountName, AccountType accountType)
 {
     return queryService.IsExistingUser(accountName, (Querying.Data.AccountType)accountType);
 }
コード例 #8
0
 public IUser GetUser(string accountName, AccountType accountType)
 {
     var mapper = new UserMapper();
     return mapper.Map(queryService.GetUser(accountName, (Querying.Data.AccountType)accountType));
 }
コード例 #9
0
 public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable<string> authenticatedGroups)
 {
     return AddUser(accountName, type, displayName, authenticatedGroups, null);
 }
コード例 #10
0
        public void UpdateUserGroupsAndRoles(string accountName, AccountType accountType, IEnumerable <string> authenticatedGroups)
        {
            Guid userId = GetUser(accountName, accountType).Id;

            SetRolesAndGroups(userId, authenticatedGroups);
        }
コード例 #11
0
 public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable <string> authenticatedGroups)
 {
     return(AddUser(accountName, type, displayName, authenticatedGroups, null));
 }
コード例 #12
0
        public IUser GetUser(string accountName, AccountType accountType)
        {
            var mapper = new UserMapper();

            return(mapper.Map(queryService.GetUser(accountName, (Querying.Data.AccountType)accountType)));
        }
コード例 #13
0
 public bool IsExistingUserAccount(string accountName, AccountType accountType)
 {
     return(queryService.IsExistingUser(accountName, (Querying.Data.AccountType)accountType));
 }