Esempio n. 1
0
 public SiteRoleManager(
     SiteContext currentSite,
     IUserCommands userCommands,
     IUserQueries userQueries,
     IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
     IRoleStore <TRole> roleStore,
     IEnumerable <IRoleValidator <TRole> > roleValidators,
     ILookupNormalizer keyNormalizer,
     IdentityErrorDescriber errors,
     ILogger <RoleManager <TRole> > logger,
     IHttpContextAccessor contextAccessor,
     IEnumerable <IHandleUserAddedToRole> userAddedToRoleHandlers,
     IEnumerable <IHandleUserRemovedFromRole> userRemovedFromRoleHandlers
     ) : base(
         roleStore,
         roleValidators,
         keyNormalizer,
         errors,
         logger)
 {
     if (roleStore == null)
     {
         throw new ArgumentNullException(nameof(roleStore));
     }
     _commands                    = userCommands ?? throw new ArgumentNullException(nameof(userCommands));
     _queries                     = userQueries ?? throw new ArgumentNullException(nameof(userQueries));
     _siteSettings                = currentSite ?? throw new ArgumentNullException(nameof(currentSite));
     _log                         = logger;
     _multiTenantOptions          = multiTenantOptionsAccessor.Value;
     _context                     = contextAccessor?.HttpContext;
     _userAddedToRoleHandlers     = userAddedToRoleHandlers;
     _userRemovedFromRoleHandlers = userRemovedFromRoleHandlers;
 }
Esempio n. 2
0
        public SiteManager(
            SiteContext currentSite,
            ISiteCommands siteCommands,
            ISiteQueries siteQueries,
            IUserCommands userCommands,
            IUserQueries userQueries,
            SiteDataProtector dataProtector,
            IHttpContextAccessor contextAccessor,
            ILogger<SiteManager> logger,
            IOptions<MultiTenantOptions> multiTenantOptionsAccessor,
            IOptions<SiteConfigOptions> setupOptionsAccessor,
            CacheHelper cacheHelper
            )
        {

            commands = siteCommands;
            queries = siteQueries;
            this.userCommands = userCommands;
            this.userQueries = userQueries;
            multiTenantOptions = multiTenantOptionsAccessor.Value;
            setupOptions = setupOptionsAccessor.Value;
            _context = contextAccessor?.HttpContext;
            this.dataProtector = dataProtector;
            log = logger;

            //resolver = siteResolver;
            siteSettings = currentSite;
            this.cacheHelper = cacheHelper;
        }
Esempio n. 3
0
        public SiteManager(
            SiteSettings currentSite,
            ISiteCommands siteCommands,
            ISiteQueries siteQueries,
            IUserCommands userCommands,
            IUserQueries userQueries,
            SiteDataProtector dataProtector,
            IHttpContextAccessor contextAccessor,
            ILogger <SiteManager> logger,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
            IOptions <SiteConfigOptions> setupOptionsAccessor,
            CacheHelper cacheHelper
            )
        {
            commands           = siteCommands;
            queries            = siteQueries;
            this.userCommands  = userCommands;
            this.userQueries   = userQueries;
            multiTenantOptions = multiTenantOptionsAccessor.Value;
            setupOptions       = setupOptionsAccessor.Value;
            _context           = contextAccessor?.HttpContext;
            this.dataProtector = dataProtector;
            log = logger;

            //resolver = siteResolver;
            siteSettings     = currentSite;
            this.cacheHelper = cacheHelper;
        }
Esempio n. 4
0
        public SiteManager(
            SiteContext currentSite,
            SiteEvents siteEventHandlers,
            ISiteCommands siteCommands,
            ISiteQueries siteQueries,
            IUserCommands userCommands,
            IUserQueries userQueries,
            SiteDataProtector dataProtector,
            IHttpContextAccessor contextAccessor,
            ILogger <SiteManager> logger,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
            IOptions <SiteConfigOptions> setupOptionsAccessor,
            CacheHelper cacheHelper
            )
        {
            _commands           = siteCommands;
            _queries            = siteQueries;
            _userCommands       = userCommands;
            _userQueries        = userQueries;
            _multiTenantOptions = multiTenantOptionsAccessor.Value;
            _setupOptions       = setupOptionsAccessor.Value;
            _context            = contextAccessor?.HttpContext;
            _dataProtector      = dataProtector;
            _log = logger;

            //resolver = siteResolver;
            _currentSite   = currentSite;
            _cacheHelper   = cacheHelper;
            _eventHandlers = siteEventHandlers;
        }
Esempio n. 5
0
        public RoleStore(
            SiteContext currentSite,
            ILogger <RoleStore <TRole> > logger,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
            IUserCommands userCommands,
            IUserQueries userQueries
            )
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (currentSite == null)
            {
                throw new ArgumentNullException(nameof(currentSite));
            }
            if (userCommands == null)
            {
                throw new ArgumentNullException(nameof(userCommands));
            }
            commands = userCommands;

            if (userQueries == null)
            {
                throw new ArgumentNullException(nameof(userQueries));
            }
            queries = userQueries;

            log          = logger;
            siteSettings = currentSite;

            multiTenantOptions = multiTenantOptionsAccessor.Value;
        }
Esempio n. 6
0
        /// <summary>
        /// Initializes a new <see cref="DevRantClient"/>.
        /// </summary>
        public DevRantClient()
        {
            client             = new HttpClient();
            client.BaseAddress = new Uri(Constants.BaseAddress);

            feeds = new FeedCommands(this, client);
            user  = new UserCommands(this, client);
        }
Esempio n. 7
0
 public UserService(IUserCommands userCommands, IUserQueries userQueries, [ImportMany] IEnumerable <Lazy <IPasswordStrategy, IPrioritisedMefMetaData> > passwordStrategies,
                    IPasswordPolicy passwordPolicy, IOAuthRegisteredClientCollection oAuthRegisteredClientCollection)
 {
     _userCommands     = userCommands;
     _userQueries      = userQueries;
     _passwordStrategy = passwordStrategies.OrderByDescending(x => x.Metadata.Priority).First().Value;
     _passwordPolicy   = passwordPolicy;
     _oAuthRegisteredClientCollection = oAuthRegisteredClientCollection;
 }
Esempio n. 8
0
 public AccountController(
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     ILogger <AccountController> logger,
     IUserCommands userManagementService)
 {
     _userManager               = userManager;
     _signInManager             = signInManager;
     _logger                    = logger;
     this.userManagementService = userManagementService;
 }
Esempio n. 9
0
 public IpAddressTracker(
     IUserCommands userCommands,
     IUserQueries userQueries,
     ILogger <IpAddressTracker> logger,
     IHttpContextAccessor contextAccessor)
 {
     commands = userCommands;
     queries  = userQueries;
     log      = logger;
     context  = contextAccessor?.HttpContext;
 }
Esempio n. 10
0
 public IpAddressTracker(
     IUserCommands userCommands,
     IUserQueries userQueries,
     ILogger <IpAddressTracker> logger,
     IHttpContextAccessor contextAccessor)
 {
     _commands        = userCommands;
     _queries         = userQueries;
     _log             = logger;
     _contextAccessor = contextAccessor;
 }
Esempio n. 11
0
 public IpAddressTracker(
     IUserCommands userCommands,
     IUserQueries userQueries,
     ILogger<IpAddressTracker> logger,
     IHttpContextAccessor contextAccessor)
 {
     commands = userCommands;
     queries = userQueries;
     log = logger;
     context = contextAccessor?.HttpContext;
 }
Esempio n. 12
0
        public SiteUserManager(
            SiteContext currentSite,
            UserEvents userEventHandlers,
            IEnumerable <IHandleUserEmailConfirmed> emailConfirmedHandlers,
            IUserCommands userCommands,
            IUserQueries userQueries,
            IUserStore <TUser> store,
            IOptions <IdentityOptions> optionsAccessor,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
            INewUserDisplayNameResolver displayNameResolver,
            IPasswordHasher <TUser> passwordHasher,
            IEnumerable <IUserValidator <TUser> > userValidators,
            IEnumerable <IPasswordValidator <TUser> > passwordValidators,
            ILookupNormalizer lookupNormalizer,
            IdentityErrorDescriber errors,
            IServiceProvider serviceProvider,
            ILogger <UserManager <TUser> > logger,
            IHttpContextAccessor contextAccessor)
            : base(
                store,
                optionsAccessor,
                passwordHasher,
                userValidators,
                passwordValidators,
                lookupNormalizer,
                errors,
                serviceProvider,
                logger)
        {
            identityOptions = optionsAccessor.Value;
            userStore       = store;

            if (userCommands == null)
            {
                throw new ArgumentNullException(nameof(userCommands));
            }
            commands = userCommands;

            if (userQueries == null)
            {
                throw new ArgumentNullException(nameof(userQueries));
            }
            queries = userQueries;

            siteSettings            = currentSite;
            multiTenantOptions      = multiTenantOptionsAccessor.Value;
            this.contextAccessor    = contextAccessor;
            httpContext             = contextAccessor?.HttpContext;
            eventHandlers           = userEventHandlers;
            this.passwordHasher     = passwordHasher;
            _emailConfirmedHandlers = emailConfirmedHandlers;
            _displayNameResolver    = displayNameResolver;
        }
Esempio n. 13
0
 public RoleStore(
     SiteContext currentSite,
     ILogger <RoleStore <TRole> > logger,
     IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
     IUserCommands userCommands,
     IUserQueries userQueries
     )
 {
     _commands           = userCommands ?? throw new ArgumentNullException(nameof(userCommands));
     _queries            = userQueries ?? throw new ArgumentNullException(nameof(userQueries));
     _log                = logger ?? throw new ArgumentNullException(nameof(logger));
     _siteSettings       = currentSite ?? throw new ArgumentNullException(nameof(currentSite));
     _multiTenantOptions = multiTenantOptionsAccessor.Value;
 }
Esempio n. 14
0
        public AuthController(IUserQueries queries, IUserCommands commands)
        {
            this.queries  = queries;
            this.commands = commands;

            // gross hack
            var secretKey  = "Restaurantoppatomus!123";
            var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(secretKey));

            options = new TokenProviderOptions
            {
                Audience           = "TheWorld",
                Issuer             = "Restaurantoppotamus",
                SigningCredentials = new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256),
            };
        }
Esempio n. 15
0
 public HybridFlowHelper(
     IUserQueries userQueries,
     IUserCommands userCommands,
     IDistributedCache distributedCache,
     OidcTokenEndpointService oidcTokenEndpointService,
     IOptions <OidcTokenManagementOptions> tokenOptions,
     ISystemClock clock,
     ILogger <HybridFlowHelper> logger
     )
 {
     _userQueries              = userQueries;
     _userCommands             = userCommands;
     _cache                    = distributedCache;
     _oidcTokenEndpointService = oidcTokenEndpointService;
     _tokenOptions             = tokenOptions.Value;
     _clock                    = clock;
     _log = logger;
 }
Esempio n. 16
0
        public SiteRoleManager(
            SiteSettings currentSite,
            IUserCommands userCommands,
            IUserQueries userQueries,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor,
            IRoleStore <TRole> roleStore,
            IEnumerable <IRoleValidator <TRole> > roleValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            ILogger <RoleManager <TRole> > logger,
            IHttpContextAccessor contextAccessor
            ) : base(
                roleStore,
                roleValidators,
                keyNormalizer,
                errors,
                logger,
                contextAccessor)
        {
            if (currentSite == null)
            {
                throw new ArgumentNullException(nameof(currentSite));
            }
            if (roleStore == null)
            {
                throw new ArgumentNullException(nameof(roleStore));
            }
            if (userCommands == null)
            {
                throw new ArgumentNullException(nameof(userCommands));
            }
            commands = userCommands;

            if (userQueries == null)
            {
                throw new ArgumentNullException(nameof(userQueries));
            }
            queries = userQueries;

            siteSettings       = currentSite;
            this.logger        = logger;
            multiTenantOptions = multiTenantOptionsAccessor.Value;
            _context           = contextAccessor?.HttpContext;
        }
Esempio n. 17
0
        public UserStore(
            SiteSettings currentSite,
            ILogger <UserStore <TUser> > logger,
            IUserCommands userCommands,
            IUserQueries userQueries,
            IOptions <MultiTenantOptions> multiTenantOptionsAccessor
            )
        {
            log = logger;

            if (currentSite == null)
            {
                throw new ArgumentNullException(nameof(currentSite));
            }

            _siteSettings = currentSite;

            if (userCommands == null)
            {
                throw new ArgumentNullException(nameof(userCommands));
            }
            commands = userCommands;

            if (userQueries == null)
            {
                throw new ArgumentNullException(nameof(userQueries));
            }
            queries = userQueries;


            multiTenantOptions = multiTenantOptionsAccessor.Value;

            //debugLog = config.GetOrDefault("AppSettings:UserStoreDebugEnabled", false);

            if (debugLog)
            {
                log.LogInformation("constructor");
            }
        }
Esempio n. 18
0
 public AccountService(
     SiteUserManager <SiteUser> userManager,
     SignInManager <SiteUser> signInManager,
     IIdentityServerIntegration identityServerIntegration,
     ISocialAuthEmailVerfificationPolicy socialAuthEmailVerificationPolicy,
     ILdapHelper ldapHelper,
     IUserCommands userCommands,
     IProcessAccountLoginRules loginRulesProcessor,
     INewUserDisplayNameResolver displayNameResolver,
     IOptions <CustomSocialAuthSchemes> customSchemesAccessor
     //,ILogger<AccountService> logger
     )
 {
     UserManager                       = userManager;
     SignInManager                     = signInManager;
     IdentityServerIntegration         = identityServerIntegration;
     SocialAuthEmailVerificationPolicy = socialAuthEmailVerificationPolicy;
     LoginRulesProcessor               = loginRulesProcessor;
     DisplayNameResolver               = displayNameResolver;
     CustomSocialAuthSchemes           = customSchemesAccessor.Value;
     LdapHelper   = ldapHelper;
     UserCommands = userCommands;
 }
 public UsersService(IUserQueries userQueries, IUserCommands userCommands)
 {
     mUserQueries  = userQueries;
     mUserCommands = userCommands;
 }
Esempio n. 20
0
 public UserEraser(IUserRepository userRepository, IUserCommands userCommands)
 {
     this.userRepository = userRepository;
     this.userCommands   = userCommands;
 }
Esempio n. 21
0
        private static async Task EnsureData(
            ISiteQueries siteQueries,
            ISiteCommands siteCommands,
            IUserQueries userQueries,
            IUserCommands userCommands,
            IGeoQueries geoQueries,
            IGeoCommands geoCommands,
            IBasicQueries <SiteRole> roleQueries,
            IBasicQueries <SiteUser> userBasic,
            IProjectResolver projectResolver
            )
        {
            int count = await geoQueries.GetCountryCount();

            if (count == 0)
            {
                foreach (GeoCountry c in InitialData.BuildCountryList())
                {
                    await geoCommands.Add(c);
                }

                foreach (GeoZone c in InitialData.BuildStateList())
                {
                    await geoCommands.Add(c);
                }
            }

            //count = await geoQueries.GetLanguageCount();
            //if (count == 0)
            //{
            //    foreach (Language c in InitialData.BuildLanguageList())
            //    {
            //        await geoCommands.Add(c);
            //    }
            //}

            var all = await geoQueries.GetAllCurrencies();

            count = all.Count;
            if (count == 0)
            {
                foreach (Currency c in InitialData.BuildCurrencyList())
                {
                    await geoCommands.Add(c);
                }
            }

            count = await siteQueries.GetCount();

            SiteSettings newSite = null;

            if (count == 0)
            {
                // create first site
                newSite = InitialData.BuildInitialSite();
                await siteCommands.Create(newSite);
            }

            // ensure roles
            var projectId = await projectResolver.ResolveProjectId();

            count = await roleQueries.GetCountAsync(projectId);

            if (count == 0)
            {
                var adminRole = InitialData.BuildAdminRole();
                adminRole.SiteId = newSite.Id;
                await userCommands.CreateRole(adminRole);

                var roleAdminRole = InitialData.BuildRoleAdminRole();
                roleAdminRole.SiteId = newSite.Id;
                await userCommands.CreateRole(roleAdminRole);

                var contentAdminRole = InitialData.BuildContentAdminsRole();
                contentAdminRole.SiteId = newSite.Id;
                await userCommands.CreateRole(contentAdminRole);

                var authenticatedUserRole = InitialData.BuildAuthenticatedRole();
                authenticatedUserRole.SiteId = newSite.Id;
                await userCommands.CreateRole(authenticatedUserRole);
            }

            // ensure admin user
            count = await userBasic.GetCountAsync(projectId);

            if (count == 0)
            {
                var role = await userQueries.FetchRole(newSite.Id, "Administrators");

                if (role != null)
                {
                    var adminUser = InitialData.BuildInitialAdmin();
                    adminUser.SiteId = newSite.Id;
                    await userCommands.Create(adminUser);

                    await userCommands.AddUserToRole(role.Id, adminUser.Id);

                    role = await userQueries.FetchRole(newSite.Id, "Authenticated Users");

                    if (role != null)
                    {
                        await userCommands.AddUserToRole(role.Id, adminUser.Id);
                    }
                }
            }
        }
Esempio n. 22
0
        private static async Task EnsureData(
            ISiteQueries siteQueries,
            ISiteCommands siteCommands,
            IUserQueries userQueries,
            IUserCommands userCommands,
            IGeoQueries geoQueries,
            IGeoCommands geoCommands,
            IBasicQueries <SiteRole> roleQueries,
            IBasicQueries <SiteUser> userBasic

            )
        {
            int count = await geoQueries.GetCountryCount();

            if (count == 0)
            {
                foreach (GeoCountry c in InitialData.BuildCountryList())
                {
                    await geoCommands.Add(c);
                }

                foreach (GeoZone c in InitialData.BuildStateList())
                {
                    await geoCommands.Add(c);
                }
            }

            count = await siteQueries.GetCount();

            SiteSettings newSite = null;

            Guid siteId = Guid.Empty;

            if (count == 0)
            {
                // create first site
                newSite = InitialData.BuildInitialSite();
                await siteCommands.Create(newSite);

                siteId = newSite.Id;
            }
            else if (count == 1)
            {
                var allSites = await siteQueries.GetList().ConfigureAwait(false);

                var site = allSites[0];
                if (site != null)
                {
                    siteId = site.Id;
                }
            }
            else
            {
                return;
            }

            // ensure roles
            //var projectId = await projectResolver.ResolveProjectId();
            var projectId = siteId.ToString();;


            count = await roleQueries.GetCountAsync(projectId);

            if (count == 0)
            {
                var adminRole = InitialData.BuildAdminRole();
                adminRole.SiteId = siteId;
                await userCommands.CreateRole(adminRole);

                var roleAdminRole = InitialData.BuildRoleAdminRole();
                roleAdminRole.SiteId = siteId;
                await userCommands.CreateRole(roleAdminRole);

                var contentAdminRole = InitialData.BuildContentAdminsRole();
                contentAdminRole.SiteId = siteId;
                await userCommands.CreateRole(contentAdminRole);

                var authenticatedUserRole = InitialData.BuildAuthenticatedRole();
                authenticatedUserRole.SiteId = siteId;
                await userCommands.CreateRole(authenticatedUserRole);
            }

            // ensure admin user
            count = await userBasic.GetCountAsync(projectId);

            if (count == 0)
            {
                var role = await userQueries.FetchRole(newSite.Id, "Administrators");

                if (role != null)
                {
                    var adminUser = InitialData.BuildInitialAdmin();
                    adminUser.SiteId         = siteId;
                    adminUser.CanAutoLockout = false;
                    await userCommands.Create(adminUser);

                    await userCommands.AddUserToRole(siteId, role.Id, adminUser.Id);

                    role = await userQueries.FetchRole(siteId, "Authenticated Users");

                    if (role != null)
                    {
                        await userCommands.AddUserToRole(siteId, role.Id, adminUser.Id);
                    }
                }
            }
        }
Esempio n. 23
0
 public UserController(IUserQueries userQueries, IUserCommands userCommands)
 {
     _userQueries  = userQueries;
     _userCommands = userCommands;
 }
Esempio n. 24
0
 public UserService(IUserCommands userCommands, IUserQueries userQueries)
 {
     _userCommands = userCommands;
     _userQueries  = userQueries;
 }
 public UsersController(IUserCommands <UserDTO> userCommands, IUserQueries <UserDTO> userQueries)
 {
     _userCommands = userCommands;
     _userQueries  = userQueries;
 }
Esempio n. 26
0
 public UsersService(IUserQueries userQueries, IUserCommands userCommands)
 {
     mUserQueries = userQueries;
     mUserCommands = userCommands;
 }
Esempio n. 27
0
 public RegisterService(IUserRepository userRepository, IUserCommands userCommands, SuscribersNotifier notifier)
 {
     this.userRepository = userRepository;
     this.userCommands   = userCommands;
     this.notifier       = notifier;
 }
Esempio n. 28
0
        private static async Task EnsureData(
            ISiteQueries siteQueries,
            ISiteCommands siteCommands,
            IUserQueries userQueries,
            IUserCommands userCommands,
            IGeoQueries geoQueries,
            IGeoCommands geoCommands,
            IBasicQueries<SiteRole> roleQueries,
            IBasicQueries<SiteUser> userBasic
            
            )
        {
            
            int count = await geoQueries.GetCountryCount();
            if (count == 0)
            {
                foreach (GeoCountry c in InitialData.BuildCountryList())
                {
                    await geoCommands.Add(c);
                }

                foreach (GeoZone c in InitialData.BuildStateList())
                {
                    await geoCommands.Add(c);
                }
            }
            
            count = await siteQueries.GetCount();
            SiteSettings newSite = null;
            
            Guid siteId = Guid.Empty;
            if (count == 0)
            {
                // create first site
                newSite = InitialData.BuildInitialSite();
                await siteCommands.Create(newSite);
                siteId = newSite.Id;
                
            }
            else if(count == 1)
            {
                var allSites = await siteQueries.GetList().ConfigureAwait(false);
                var site = allSites[0];
                if (site != null) siteId = site.Id;
            }
            else
            {
                return;
            }

            // ensure roles
            //var projectId = await projectResolver.ResolveProjectId();
            var projectId = siteId.ToString(); ;


            count = await roleQueries.GetCountAsync(projectId);
            if (count == 0)
            {
                var adminRole = InitialData.BuildAdminRole();
                adminRole.SiteId = siteId;
                await userCommands.CreateRole(adminRole);
                
                var roleAdminRole = InitialData.BuildRoleAdminRole();
                roleAdminRole.SiteId = siteId;
                await userCommands.CreateRole(roleAdminRole);
                
                var contentAdminRole = InitialData.BuildContentAdminsRole();
                contentAdminRole.SiteId = siteId;
                await userCommands.CreateRole(contentAdminRole);

                var authenticatedUserRole = InitialData.BuildAuthenticatedRole();
                authenticatedUserRole.SiteId = siteId;
                await userCommands.CreateRole(authenticatedUserRole);
                
            }

            // ensure admin user
            count = await userBasic.GetCountAsync(projectId);

            if (count == 0)
            {
                var role = await userQueries.FetchRole(newSite.Id, "Administrators");
                
                if (role != null)
                {
                    var adminUser = InitialData.BuildInitialAdmin();
                    adminUser.SiteId = siteId;
                    await userCommands.Create(adminUser);
                    
                    await userCommands.AddUserToRole(siteId, role.Id, adminUser.Id);

                    role = await userQueries.FetchRole(siteId, "Authenticated Users");
                    
                    if (role != null)
                    {
                        await userCommands.AddUserToRole(siteId, role.Id, adminUser.Id);
                    }
                }
                
            }

        }
Esempio n. 29
0
 public PasswordChanger(IUserCommands userCommands, IUserRepository userRepository)
 {
     this.userCommands   = userCommands;
     this.userRepository = userRepository;
 }
Esempio n. 30
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IUserQueries userQueries, IUserCommands userCommands)
 {
     _logger       = logger;
     _userQueries  = userQueries;
     _userCommands = userCommands;
 }