Ejemplo n.º 1
0
        public OctopusAsyncRepository(IOctopusAsyncClient client, RepositoryScope repositoryScope = null)
        {
            Client                    = client;
            Scope                     = repositoryScope ?? RepositoryScope.Unspecified();
            Accounts                  = new AccountRepository(this);
            ActionTemplates           = new ActionTemplateRepository(this);
            Artifacts                 = new ArtifactRepository(this);
            Backups                   = new BackupRepository(this);
            BuiltInPackageRepository  = new BuiltInPackageRepositoryRepository(this);
            CertificateConfiguration  = new CertificateConfigurationRepository(this);
            Certificates              = new CertificateRepository(this);
            Channels                  = new ChannelRepository(this);
            CommunityActionTemplates  = new CommunityActionTemplateRepository(this);
            Configuration             = new ConfigurationRepository(this);
            DashboardConfigurations   = new DashboardConfigurationRepository(this);
            Dashboards                = new DashboardRepository(this);
            Defects                   = new DefectsRepository(this);
            DeploymentProcesses       = new DeploymentProcessRepository(this);
            Deployments               = new DeploymentRepository(this);
            Environments              = new EnvironmentRepository(this);
            Events                    = new EventRepository(this);
            FeaturesConfiguration     = new FeaturesConfigurationRepository(this);
            Feeds                     = new FeedRepository(this);
            Interruptions             = new InterruptionRepository(this);
            LibraryVariableSets       = new LibraryVariableSetRepository(this);
            Lifecycles                = new LifecyclesRepository(this);
            MachinePolicies           = new MachinePolicyRepository(this);
            MachineRoles              = new MachineRoleRepository(this);
            Machines                  = new MachineRepository(this);
            Migrations                = new MigrationRepository(this);
            OctopusServerNodes        = new OctopusServerNodeRepository(this);
            PerformanceConfiguration  = new PerformanceConfigurationRepository(this);
            PackageMetadataRepository = new PackageMetadataRepository(this);
            ProjectGroups             = new ProjectGroupRepository(this);
            Projects                  = new ProjectRepository(this);
            ProjectTriggers           = new ProjectTriggerRepository(this);
            Proxies                   = new ProxyRepository(this);
            Releases                  = new ReleaseRepository(this);
            RetentionPolicies         = new RetentionPolicyRepository(this);
            Schedulers                = new SchedulerRepository(this);
            ServerStatus              = new ServerStatusRepository(this);
            Spaces                    = new SpaceRepository(this);
            Subscriptions             = new SubscriptionRepository(this);
            TagSets                   = new TagSetRepository(this);
            Tasks                     = new TaskRepository(this);
            Teams                     = new TeamsRepository(this);
            Tenants                   = new TenantRepository(this);
            TenantVariables           = new TenantVariablesRepository(this);
            UserInvites               = new UserInvitesRepository(this);
            UserRoles                 = new UserRolesRepository(this);
            Users                     = new UserRepository(this);
            VariableSets              = new VariableSetRepository(this);
            Workers                   = new WorkerRepository(this);
            WorkerPools               = new WorkerPoolRepository(this);
            ScopedUserRoles           = new ScopedUserRoleRepository(this);
            UserPermissions           = new UserPermissionsRepository(this);

            loadRootResource      = new Lazy <Task <RootResource> >(LoadRootDocumentInner, true);
            loadSpaceRootResource = new Lazy <Task <SpaceRootResource> >(LoadSpaceRootDocumentInner, true);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage GetLoggedInUser()
        {
            var          user       = UsersRepository.Users.Values.ElementAt(rnd.Next(0, UsersRepository.Users.Keys.Count));
            List <Roles> _userRoles = new List <Roles>();

            _userRoles.AddRange(UserRolesRepository.GetUserRoles(user.Email).SelectMany(x => x.Value));

            List <RolePermissions> _userRolePermissions = new List <RolePermissions>();

            foreach (var userrole in _userRoles)
            {
                _userRolePermissions.Add(RolePermissionsRepository.Get(userrole.Name));
            }

            List <Permissions> _userPermissions = new List <Permissions>();

            foreach (var rp in _userRolePermissions)
            {
                _userPermissions.AddRange(PermissionsRepository.Permissions.Values.Where(p => rp.PermissionIds.Contains(p.Id)));
            }

            var content = new ObjectContent <UserProfile>(new UserProfile
            {
                User        = user,
                Roles       = _userRoles,
                Permissions = _userPermissions
            }, new JsonMediaTypeFormatter());

            var response = Request.CreateResponse();

            response.Content    = content;
            response.StatusCode = HttpStatusCode.OK;
            return(response);
        }
 public UserRolesServices()
 {
     if (userRolesRepository == null)
     {
         userRolesRepository = new UserRolesRepository();
     }
 }
Ejemplo n.º 4
0
 public UserRoleService(DiscordSocketClient client, UserRolesRepository repository, ILogger <UserRoleService> logger)
 {
     this._client     = client;
     this._repository = repository;
     this._logger     = logger;
     this._userRoles  = new List <UserRoleDto>();
 }
Ejemplo n.º 5
0
 public UnitOfwork(HospitalClientManagement_db hospitalClientManagement_db)
 {
     _hospitalClientManagement_db = hospitalClientManagement_db;
     UserRoles = new UserRolesRepository(_hospitalClientManagement_db);
     Users     = new UserRepository(_hospitalClientManagement_db);
     Roles     = new RolesRepository(_hospitalClientManagement_db);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 默认构造函数
 /// </summary>
 public UserStore()
 {
     userRepository      = new UserRepository <IdentityUser>();
     roleRepository      = new RoleRepository <IdentityRole>();
     userRoleRepository  = new UserRolesRepository();
     userClaimRepository = new UserClaimsRepository();
     userLoginRepository = new UserLoginsRepository();
 }
Ejemplo n.º 7
0
        public override string[] GetUsersInRole(string roleName)
        {
            int id = int.Parse(roleName);
            var dbcxt = new GazSimpleUsersDbContext();
            var urrepo = new UserRolesRepository(dbcxt);
            var role = urrepo.GetByID(id, r => r.Users);

            return role.Users.Select(s => s.Username).ToArray();
        }
        public void WhenGetAllFromEmptyDatabase_ThenReturnsEmptyCollection()
        {
            var repository = new UserRolesRepository(new DatabaseFactory());
            IEnumerable<UserRole> actual = repository.GetAll();

            Assert.NotNull(actual);
            var actualList = new List<UserRole>(actual);
            Assert.Equal(0, actualList.Count);
        }
Ejemplo n.º 9
0
        public async Task <List <UserRole> > GetUserRolesForProject(Project project, int userId)
        {
            List <UserRole> roles = await UserRolesRepository.Get()
                                    .Where(ur => ur.OrganizationId == project.OrganizationId)
                                    .Where(ur => ur.UserId == userId)
                                    .ToListAsync();

            return(roles);
        }
Ejemplo n.º 10
0
        public async Task <IActionResult> List()
        {
            var model = new RolesListViewModel
            {
                UserRoles = (await UserRolesRepository.GetAllRolesAsync()).ToList()
            };

            return(View(model));
        }
 /// <summary>
 /// Default constructor that initializes a new database
 /// instance using the Default Connection string
 /// </summary>
 public UserStore()
 {
     Database       = new DbManager();
     usersRepo      = new UsersRepository <TUser>(Database);
     rolesRepo      = new RolesRepository(Database);
     userRolesRepo  = new UserRolesRepository(Database);
     userClaimsRepo = new UserClaimsRepository(Database);
     userLoginsRepo = new UserLoginsRepository(Database);
 }
Ejemplo n.º 12
0
        public UnitOfWork(DatabaseContext context)
        {
            _context = context ?? throw new ArgumentNullException(nameof(context));

            Likes = new LikesRepository(_context);
            Messages = new MessagesRepository(_context);
            Photos = new PhotosRepository(_context);
            Users = new UsersRepository(_context);
            UserRoles = new UserRolesRepository(_context);
        }
Ejemplo n.º 13
0
        public UserStore(OracleDataContext database)
        {
            // TODO: Compare with EntityFramework provider.
            Database = database;

            _userRepository       = new UserRepository(database);
            _roleRepository       = new RoleRepository(database);
            _userRolesRepository  = new UserRolesRepository(database);
            _userLoginsRepository = new UserLoginsRepository(database);
        }
Ejemplo n.º 14
0
        public async Task <IActionResult> List()
        {
            var model = new UsersListViewModel
            {
                Users = (await UsersRepository.GetAllAsync()).ToList(),
                Roles = (await UserRolesRepository.GetAllRolesAsync()).ToDictionary(itm => itm.Id)
            };

            return(View(model));
        }
Ejemplo n.º 15
0
        public async Task <IActionResult> EditDialog(string id)
        {
            var model = new EditUserDialogViewModel
            {
                User    = string.IsNullOrEmpty(id) ? BackOfficeUser.CreateDefault() : await UsersRepository.GetAsync(id),
                Caption = string.IsNullOrEmpty(id) ? Phrases.AddUser : Phrases.EditUser,
                Roles   = (await UserRolesRepository.GetAllRolesAsync()).ToDictionary(itm => itm.Id),
                Width   = "900px"
            };

            return(View(model));
        }
Ejemplo n.º 16
0
        public bool DeleteUserRole(IList <TUSRROL> userRoles)
        {
            dbEntities           db          = new dbEntities();
            IUserRolesRepository _repository = new UserRolesRepository(db);

            foreach (TUSRROL ur in userRoles)
            {
                _repository.GetUserRoles(ur).ForEach(u => _repository.DeleteOnSubmit(u));
            }
            _repository.SaveChanges();
            return(true);
        }
Ejemplo n.º 17
0
        public OctopusAsyncRepository(IOctopusAsyncClient client)
        {
            this.Client = client;

            Accounts                 = new AccountRepository(client);
            ActionTemplates          = new ActionTemplateRepository(client);
            Artifacts                = new ArtifactRepository(client);
            Backups                  = new BackupRepository(client);
            BuiltInPackageRepository = new BuiltInPackageRepositoryRepository(client);
            CertificateConfiguration = new CertificateConfigurationRepository(client);
            Certificates             = new CertificateRepository(client);
            Channels                 = new ChannelRepository(client);
            CommunityActionTemplates = new CommunityActionTemplateRepository(client);
            Configuration            = new ConfigurationRepository(client);
            DashboardConfigurations  = new DashboardConfigurationRepository(client);
            Dashboards               = new DashboardRepository(client);
            Defects                  = new DefectsRepository(client);
            DeploymentProcesses      = new DeploymentProcessRepository(client);
            Deployments              = new DeploymentRepository(client);
            Environments             = new EnvironmentRepository(client);
            Events = new EventRepository(client);
            FeaturesConfiguration = new FeaturesConfigurationRepository(client);
            Feeds                    = new FeedRepository(client);
            Interruptions            = new InterruptionRepository(client);
            LibraryVariableSets      = new LibraryVariableSetRepository(client);
            Lifecycles               = new LifecyclesRepository(client);
            MachinePolicies          = new MachinePolicyRepository(client);
            MachineRoles             = new MachineRoleRepository(client);
            Machines                 = new MachineRepository(client);
            Migrations               = new MigrationRepository(client);
            OctopusServerNodes       = new OctopusServerNodeRepository(client);
            PerformanceConfiguration = new PerformanceConfigurationRepository(client);
            ProjectGroups            = new ProjectGroupRepository(client);
            Projects                 = new ProjectRepository(client);
            ProjectTriggers          = new ProjectTriggerRepository(client);
            Proxies                  = new ProxyRepository(client);
            Releases                 = new ReleaseRepository(client);
            RetentionPolicies        = new RetentionPolicyRepository(client);
            Schedulers               = new SchedulerRepository(client);
            ServerStatus             = new ServerStatusRepository(client);
            Subscriptions            = new SubscriptionRepository(client);
            TagSets                  = new TagSetRepository(client);
            Tasks                    = new TaskRepository(client);
            Teams                    = new TeamsRepository(client);
            Tenants                  = new TenantRepository(client);
            TenantVariables          = new TenantVariablesRepository(client);
            UserRoles                = new UserRolesRepository(client);
            Users                    = new UserRepository(client);
            VariableSets             = new VariableSetRepository(client);
            Workers                  = new WorkerRepository(client);
            WorkerPools              = new WorkerPoolRepository(client);
        }
Ejemplo n.º 18
0
        public bool InsertUserRole(IList <TUSRROL> userRoles)
        {
            dbEntities           db          = new dbEntities();
            IUserRolesRepository _repository = new UserRolesRepository(db);

            foreach (TUSRROL ur in userRoles)
            {
                //ur.DATASC = DateTime.Now;
                _repository.InsertOnSubmit(ur);
            }
            _repository.SaveChanges();
            return(true);
        }
Ejemplo n.º 19
0
        public async Task SendNotificationToOrgAdminsAsync(Organization organization, String messageId, Dictionary <string, object> subs)
        {
            var orgAdmins = UserRolesRepository.Get()
                            .Include(ur => ur.User)
                            .Include(ur => ur.Role)
                            .Where(ur => ur.OrganizationId == organization.Id && ur.Role.RoleName == RoleName.OrganizationAdmin)
                            .ToList();

            foreach (UserRole orgAdmin in orgAdmins)
            {
                await SendNotificationToUserAsync(orgAdmin.User, messageId, subs, true);
            }
        }
Ejemplo n.º 20
0
        public async Task SendNotificationToSuperAdminsAsync(String messageId, Dictionary <string, object> subs)
        {
            var superAdmins = UserRolesRepository.Get()
                              .Include(ur => ur.User)
                              .Include(ur => ur.Role)
                              .Where(ur => ur.Role.RoleName == RoleName.SuperAdmin)
                              .ToList();

            foreach (UserRole superAdmin in superAdmins)
            {
                await SendNotificationToUserAsync(superAdmin.User, messageId, subs, true);
            }
        }
Ejemplo n.º 21
0
        public async Task SendNotificationToSuperAdminsAsync(String messageId, Dictionary <string, object> subs, String linkUrl = "", bool?forceEmail = true)
        {
            var superAdmins = UserRolesRepository.Get()
                              .Include(ur => ur.User)
                              .Include(ur => ur.Role)
                              .Where(ur => ur.Role.RoleName == RoleName.SuperAdmin)
                              .Select(ur => ur.User)
                              .ToList();

            foreach (User superAdmin in superAdmins.Distinct(new IdentifiableComparer()))
            {
                await SendNotificationToUserAsync(superAdmin, messageId, subs, linkUrl, forceEmail);
            }
        }
Ejemplo n.º 22
0
        public MainForm()
        {
            InitializeComponent();
            settings = SettingsProvider.Get();

            var mefLoader = MefLoader.Get();
            var container = mefLoader.GetCompositionContainerr("Mtf.Persistence");

            rolesRepository     = container.GetExportedValue <RolesRepository>();
            usersRepository     = container.GetExportedValue <UsersRepository>();
            userRolesRepository = container.GetExportedValue <UserRolesRepository>();
            optionsRepository   = container.GetExportedValue <OptionsRepository>();

            currentUser = usersRepository.GetOrCreate(Environment.UserName);
        }
Ejemplo n.º 23
0
        public async Task <ActionResult> Edit(EditRoleViewModel model)
        {
            if (string.IsNullOrEmpty(model.Name))
            {
                return(JsonFailResult(Phrases.FieldShouldNotBeEmpty, "#name"));
            }

            if (model.Features == null)
            {
                return(JsonFailResult(Phrases.PleaseSelectAtLeastOneItem, "#features"));
            }

            await UserRolesRepository.SaveAsync(model);

            return(JsonResultReloadData());
        }
Ejemplo n.º 24
0
 public UnitOfWork(AladonContext context)
 {
     Context         = context;
     Users           = new UsersRepository(context);
     Roles           = new RolesRepository(context);
     UserRoles       = new UserRolesRepository(context);
     Permissions     = new PermissionsRepository(context);
     Modules         = new ModulesRepository(context);
     LocationTypes   = new LocationTypesRepository(context);
     AssetStructures = new AssetStructureRepository(context);
     AssetPartInfors = new AssetPartInforRepository(context);
     AssetTypes      = new AssetTypeRepository(context);
     Documents       = new DocumentRepository(context);
     Parts           = new PartRepository(context);
     AssetTags       = new AssetTagRepository(context);
 }
Ejemplo n.º 25
0
        protected async Task SendRejectEmailAsync(Guid productId, WorkflowProductService.ProductActivityChangedArgs args, String comment)
        {
            var product = await ProductRepository.Get()
                          .Where(p => p.Id == productId)
                          .Include(p => p.Project)
                          .ThenInclude(pr => pr.Type)
                          .Include(p => p.Project)
                          .ThenInclude(pr => pr.Organization)
                          .Include(p => p.Project)
                          .ThenInclude(pr => pr.Owner)
                          .Include(p => p.Store)
                          .Include(p => p.ProductDefinition)
                          .FirstOrDefaultAsync();

            if (product != null)
            {
                var messageParms = new Dictionary <string, object>()
                {
                    { "projectName", product.Project.Name },
                    { "productName", product.ProductDefinition.Name },
                    { "previousState", args.PreviousState },
                    { "newState", args.CurrentState },
                    { "comment", comment }
                };
                var sentEmailToOwner = false;
                var orgAdmins        = UserRolesRepository.Get()
                                       .Include(ur => ur.User)
                                       .Include(ur => ur.Role)
                                       .Where(ur => ur.OrganizationId == product.Project.Organization.Id && ur.Role.RoleName == RoleName.OrganizationAdmin)
                                       .ToList();
                foreach (UserRole orgAdmin in orgAdmins)
                {
                    if (orgAdmin.UserId == product.Project.OwnerId)
                    {
                        sentEmailToOwner = true;
                    }
                    await SendRejectEmailToUserAsync(orgAdmin.User, messageParms);
                }
                if (!sentEmailToOwner)
                {
                    await SendRejectEmailToUserAsync(product.Project.Owner, messageParms);
                }
            }
        }
Ejemplo n.º 26
0
 public OctopusRepository(IOctopusClient client)
 {
     this.Client = client;
     Feeds = new FeedRepository(client);
     Backups = new BackupRepository(client);
     Machines = new MachineRepository(client);
     MachineRoles = new MachineRoleRepository(client);
     MachinePolicies = new MachinePolicyRepository(client);
     Subscriptions = new SubscriptionRepository(client);
     Environments = new EnvironmentRepository(client);
     Events = new EventRepository(client);
     FeaturesConfiguration = new FeaturesConfigurationRepository(client);
     ProjectGroups = new ProjectGroupRepository(client);
     Projects = new ProjectRepository(client);
     Proxies = new ProxyRepository(client);
     Tasks = new TaskRepository(client);
     Users = new UserRepository(client);
     VariableSets = new VariableSetRepository(client);
     LibraryVariableSets = new LibraryVariableSetRepository(client);
     DeploymentProcesses = new DeploymentProcessRepository(client);
     Releases = new ReleaseRepository(client);
     Deployments = new DeploymentRepository(client);
     Certificates = new CertificateRepository(client);
     Dashboards = new DashboardRepository(client);
     DashboardConfigurations = new DashboardConfigurationRepository(client);
     Artifacts = new ArtifactRepository(client);
     Interruptions = new InterruptionRepository(client);
     ServerStatus = new ServerStatusRepository(client);
     UserRoles = new UserRolesRepository(client);
     Teams = new TeamsRepository(client);
     RetentionPolicies = new RetentionPolicyRepository(client);
     Accounts = new AccountRepository(client);
     Defects = new DefectsRepository(client);
     Lifecycles = new LifecyclesRepository(client);
     OctopusServerNodes = new OctopusServerNodeRepository(client);
     Channels = new ChannelRepository(client);
     ProjectTriggers = new ProjectTriggerRepository(client);
     Schedulers = new SchedulerRepository(client);
     Tenants = new TenantRepository(client);
     TagSets = new TagSetRepository(client);
     BuiltInPackageRepository = new BuiltInPackageRepositoryRepository(client);
     ActionTemplates = new ActionTemplateRepository(client);
     CommunityActionTemplates = new CommunityActionTemplateRepository(client);
 }
Ejemplo n.º 27
0
        public async Task <bool> SendNotificationToOrgAdminsAsync(Organization organization, String messageId, Dictionary <string, object> subs, String linkUrl = "", int ownerId = 0)
        {
            var sentNotificationToOwner = false;
            var orgAdmins = UserRolesRepository.Get()
                            .Include(ur => ur.User)
                            .Include(ur => ur.Role)
                            .Where(ur => ur.OrganizationId == organization.Id && ur.Role.RoleName == RoleName.OrganizationAdmin)
                            .ToList();

            foreach (UserRole orgAdmin in orgAdmins)
            {
                if (orgAdmin.UserId == ownerId)
                {
                    sentNotificationToOwner = true;
                }
                await SendNotificationToUserAsync(orgAdmin.User, messageId, subs, linkUrl, true, true);
            }
            return(sentNotificationToOwner);
        }
        public OctopusRepository(IOctopusClient client, RepositoryScope repositoryScope = null)
        {
#if FULL_FRAMEWORK
            LocationChecker.CheckAssemblyLocation();
#endif
            Client                           = client;
            Scope                            = repositoryScope ?? RepositoryScope.Unspecified();
            Accounts                         = new AccountRepository(this);
            ActionTemplates                  = new ActionTemplateRepository(this);
            Artifacts                        = new ArtifactRepository(this);
            Backups                          = new BackupRepository(this);
            BuiltInPackageRepository         = new BuiltInPackageRepositoryRepository(this);
            BuildInformationRepository       = new BuildInformationRepository(this);
            CertificateConfiguration         = new CertificateConfigurationRepository(this);
            Certificates                     = new CertificateRepository(this);
            Channels                         = new ChannelRepository(this);
            CommunityActionTemplates         = new CommunityActionTemplateRepository(this);
            Configuration                    = new ConfigurationRepository(this);
            DashboardConfigurations          = new DashboardConfigurationRepository(this);
            Dashboards                       = new DashboardRepository(this);
            Defects                          = new DefectsRepository(this);
            DeploymentProcesses              = new DeploymentProcessRepository(this);
            DeploymentSettings               = new DeploymentSettingsRepository(this);
            Deployments                      = new DeploymentRepository(this);
            Environments                     = new EnvironmentRepository(this);
            Events                           = new EventRepository(this);
            FeaturesConfiguration            = new FeaturesConfigurationRepository(this);
            Feeds                            = new FeedRepository(this);
            Interruptions                    = new InterruptionRepository(this);
            LibraryVariableSets              = new LibraryVariableSetRepository(this);
            Lifecycles                       = new LifecyclesRepository(this);
            Licenses                         = new LicensesRepository(this);
            MachinePolicies                  = new MachinePolicyRepository(this);
            MachineRoles                     = new MachineRoleRepository(this);
            Machines                         = new MachineRepository(this);
            Migrations                       = new MigrationRepository(this);
            OctopusServerNodes               = new OctopusServerNodeRepository(this);
            PerformanceConfiguration         = new PerformanceConfigurationRepository(this);
            ProjectGroups                    = new ProjectGroupRepository(this);
            Projects                         = new ProjectRepository(this);
            Runbooks                         = new RunbookRepository(this);
            RunbookProcesses                 = new RunbookProcessRepository(this);
            RunbookSnapshots                 = new RunbookSnapshotRepository(this);
            RunbookRuns                      = new RunbookRunRepository(this);
            ProjectTriggers                  = new ProjectTriggerRepository(this);
            Proxies                          = new ProxyRepository(this);
            Releases                         = new ReleaseRepository(this);
            RetentionPolicies                = new RetentionPolicyRepository(this);
            Schedulers                       = new SchedulerRepository(this);
            ServerStatus                     = new ServerStatusRepository(this);
            Spaces                           = new SpaceRepository(this);
            Subscriptions                    = new SubscriptionRepository(this);
            TagSets                          = new TagSetRepository(this);
            Tasks                            = new TaskRepository(this);
            Teams                            = new TeamsRepository(this);
            TelemetryConfigurationRepository = new TelemetryConfigurationRepository(this);
            Tenants                          = new TenantRepository(this);
            TenantVariables                  = new TenantVariablesRepository(this);
            UserRoles                        = new UserRolesRepository(this);
            Users                            = new UserRepository(this);
            VariableSets                     = new VariableSetRepository(this);
            Workers                          = new WorkerRepository(this);
            WorkerPools                      = new WorkerPoolRepository(this);
            ScopedUserRoles                  = new ScopedUserRoleRepository(this);
            UserPermissions                  = new UserPermissionsRepository(this);
            UserTeams                        = new UserTeamsRepository(this);
            UserInvites                      = new UserInvitesRepository(this);
            UpgradeConfiguration             = new UpgradeConfigurationRepository(this);
            loadRootResource                 = new Lazy <RootResource>(LoadRootDocumentInner, true);
            loadSpaceRootResource            = new Lazy <SpaceRootResource>(LoadSpaceRootDocumentInner, true);
        }
Ejemplo n.º 29
0
        public async Task <IActionResult> EditDialog(string id)
        {
            var model = new EditRoleDialogViewModel
            {
                UserRole = string.IsNullOrEmpty(id) ? BackofficeUserRole.Default : await UserRolesRepository.GetAsync(id),
                Caption  = string.IsNullOrEmpty(id) ? Phrases.AddRole : Phrases.EditRole
            };

            return(View(model));
        }
Ejemplo n.º 30
0
 public UserRolesController(UserRolesRepository userRolesRepository)
 {
     this._userRolesRepo = userRolesRepository;
 }
 public AuthorizationController(IUserService userService, IUserRepository userRepository, UserRolesRepository userRolesRepository)
 {
     _userService         = userService;
     _userRepository      = userRepository;
     _userRolesRepository = userRolesRepository;
 }
Ejemplo n.º 32
0
        static void QueryUserRoles()
        {
            UserRolesRepository userRolesRepository = new UserRolesRepository(connectionString, "userroles");

            var roles = userRolesRepository.GetAll();
        }