Exemplo n.º 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));
        }
        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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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)));
        }
Exemplo n.º 5
0
        public bool IsExistingUserAccount(string accountName, AccountType type)
        {
            userContext.CheckPermission(Permissions.UserMaintenance);

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

            SetRolesAndGroups(userId, authenticatedGroups);
        }
 public bool IsExistingUserAccount(string accountName, AccountType accountType)
 {
     return queryService.IsExistingUser(accountName, (Querying.Data.AccountType)accountType);
 }
 public IUser GetUser(string accountName, AccountType accountType)
 {
     var mapper = new UserMapper();
     return mapper.Map(queryService.GetUser(accountName, (Querying.Data.AccountType)accountType));
 }
 public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable<string> authenticatedGroups)
 {
     return AddUser(accountName, type, displayName, authenticatedGroups, null);
 }
Exemplo n.º 10
0
        public void UpdateUserGroupsAndRoles(string accountName, AccountType accountType, IEnumerable <string> authenticatedGroups)
        {
            Guid userId = GetUser(accountName, accountType).Id;

            SetRolesAndGroups(userId, authenticatedGroups);
        }
Exemplo n.º 11
0
 public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable <string> authenticatedGroups)
 {
     return(AddUser(accountName, type, displayName, authenticatedGroups, null));
 }
Exemplo n.º 12
0
        public IUser GetUser(string accountName, AccountType accountType)
        {
            var mapper = new UserMapper();

            return(mapper.Map(queryService.GetUser(accountName, (Querying.Data.AccountType)accountType)));
        }
Exemplo n.º 13
0
 public bool IsExistingUserAccount(string accountName, AccountType accountType)
 {
     return(queryService.IsExistingUser(accountName, (Querying.Data.AccountType)accountType));
 }