protected void Page_Load(object sender, EventArgs e) { _webContext = new WebContext(); _userSession=new UserSession(); if (!_userSession.LoggedIn) { _redirector.GoToAccountLoginPage(); } else { _permissionRepository = new PermissionRepository(); Account account=_userSession.CurrentUser; List<Permission> permissions = _permissionRepository.GetPermissionsByAccountID(account.AccountID); int i=0; foreach (Permission p in permissions) { if (p.PermissionID != _permissionRepository.GetPermissionByName("Admin").PermissionID) { i++; } } if (i == permissions.Count) { linkAddcate.Visible = false; linkAddForum.Visible = false; lblMessage.Text = "Chỉ có Addmin mới có quyền xem trang này"; } } }
public RoleService(IRoleRepository roleRepository, ICategoryPermissionForRoleRepository categoryPermissionForRoleRepository, IPermissionRepository permissionRepository, IGlobalPermissionForRoleRepository globalPermissionForRoleRepository) { _roleRepository = roleRepository; _categoryPermissionForRoleRepository = categoryPermissionForRoleRepository; _permissionRepository = permissionRepository; _globalPermissionForRoleRepository = globalPermissionForRoleRepository; }
public PersonService( IPersonRepository personRepository, IPersonGroupRepository personGroupRepository, IPermissionRepository permissionRepository, IPersonRoleRepository personRoleRepository, IPersonOptionalFieldRepository personOptionalFieldRepository, IRelationshipRepository relationshipRepository, IChurchMatcherRepository churchMatcherRepository, IGroupRepository groupRepository, IFamilyRepository familyRepository, IEmailService emailService, IAddressRepository addressRepository, IPhotoRepository photoRepository) { _personRepository = personRepository; _personGroupRepository = personGroupRepository; _permissionRepository = permissionRepository; _personRoleRepository = personRoleRepository; _personOptionalFieldRepository = personOptionalFieldRepository; _relationshipRepository = relationshipRepository; _churchMatcherRepository = churchMatcherRepository; _groupRepository = groupRepository; _familyRepository = familyRepository; _emailService = emailService; _addressRepository = addressRepository; _photoRepository = photoRepository; }
public FirstSetupRepo() { this.session = HibernateUtil.OpenSession(false); this.userRepo = new UserRepository(session); this.projectRepo = new ProjectRepository(session); this.certificateTypeRepo = new InspectorCertificateTypeRepository(session); this.seemTypeRepo = new SeamTypeRepository(session); this.permissionRepo = new PermissionRepository(session); this.roleRepo = new RoleRepository(session); this.categoryRepo = new CategoryRepository(session); this.jointOperationRepo = new JointOperationRepository(session); this.pipeTestsRepo = new PipeTestRepository(session); this.sizeTypeRepo = new MillPipeSizeTypeRepository(session); this.plateManRepo = new PlateManufacturerRepository(session); this.heatRepo = new HeatRepository(session); this.plateRepo = new PlateRepository(session); this.purchaseRepo = new PurchaseOrderRepository(session); this.railRepo = new RailcarRepository(session); this.pipeRepo = new PipeRepository(session); this.inspectorRepo = new InspectorRepository(session); this.pipeTestResultRepo = new PipeTestResultRepository(session); this.welderRepo = new WelderRepository(session); componentTypeRepo = new ComponentTypeRepository(session); componentRepo = new ComponentRepository(session); releaseRepo = new ReleaseNoteRepository(session); this.cannedMessageRepo = new CannedMessageRepository(session); }
public RolesService(IRoleRepository roleRepository, IPermissionRepository permissionRepository, IUserForAuditingRepository auditedUserRepository, IPeninsulaLog log, IUserRepository userForAuditingRepository) { _roleRepository = roleRepository; _auditedUserRepository = auditedUserRepository; _log = log; _userForAuditingRepository = userForAuditingRepository; _permissionRepository = permissionRepository; }
public UserController(IRoleRepository RoleRepository, IPermissionRepository PermissionRepository, IPermissionsInRolesRepository PermissionsInRolesRepository, IUserMembershipRepository UserMembershipRepository, IUserProfileRepository UserProfileRepository) { this.RoleRepository = RoleRepository; this.PermissionRepository = PermissionRepository; this.PermissionsInRolesRepository = PermissionsInRolesRepository; this.UserMembershipRepository = UserMembershipRepository; this.UserProfileRepository = UserProfileRepository; }
public BaseSecurityController() { PermissionRepository = Injection.Get<IPermissionRepository>(); GroupRepository = Injection.Get<IGroupRepository>(); AccountRepository = Injection.Get<IAccountRepository>(); Uow = Injection.Get<IAuthUnitOfWork>(); }
public AccountService() { _accountRepository = ObjectFactory.GetInstance<IAccountRepository>(); _permissionRepository = ObjectFactory.GetInstance<IPermissionRepository>(); _userSession = ObjectFactory.GetInstance<IUserSession>(); _redirector = ObjectFactory.GetInstance<IRedirector>(); _email = ObjectFactory.GetInstance<IEmail>(); }
public HomeLocationUpdater(IPermissionRepository permissionRepository, ILocationRepository locationRepository) { if (permissionRepository == null) throw new ArgumentNullException(nameof(permissionRepository)); if (locationRepository == null) throw new ArgumentNullException(nameof(locationRepository)); _permissionRepository = permissionRepository; _locationRepository = locationRepository; }
public EditAccountPresenter() { _userSession = new UserSession(); _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _redirector = new Redirector(); _accountService = new AccountService(); _permissionRepository = new PermissionRepository(); _email = new Email(); }
public ProjectService(INotificationReposotory notyfication, IRepository<Project> projectsRepository, IUsersService usersService, IPermissionRepository permissionsRepository) { _notyfication = notyfication; _projectsRepository = projectsRepository; _permissionsRepository = permissionsRepository; _usersService = usersService; }
public EmailService(IUsernamePasswordRepository usernamePasswordRepository, IPersonRepository personRepository, IGroupRepository groupRepository, IEmailSender emailSender, IEmailContentService emailContentService, IChurchEmailTemplatesRepository churchEmailTemplatesRepository, IPermissionRepository permissionRepository) { _usernamePasswordRepository = usernamePasswordRepository; _personRepository = personRepository; _groupRepository = groupRepository; _emailSender = emailSender; _emailContentService = emailContentService; _churchEmailTemplatesRepository = churchEmailTemplatesRepository; _permissionRepository = permissionRepository; }
public AuthorizationService( IGroupRepository groupRepository, IPermissionRepository permissionRepository, IAccountRepository accountRepository, IUnitOfWork uow) { _permissionRepository = permissionRepository; _groupRepository = groupRepository; _unitOfWork = uow; _accountRepository = accountRepository; }
public FunctionalityToggler(IPermissionRepository permissionRepository, IBackgroundTaskRegistrar backgroundTaskRegistrar, IApplicationRepository applicationRepository) { if (permissionRepository == null) throw new ArgumentNullException(nameof(permissionRepository)); if (backgroundTaskRegistrar == null) throw new ArgumentNullException(nameof(backgroundTaskRegistrar)); if (applicationRepository == null) throw new ArgumentNullException(nameof(applicationRepository)); _permissionRepository = permissionRepository; _backgroundTaskRegistrar = backgroundTaskRegistrar; _applicationRepository = applicationRepository; }
public AccountService() { _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _permissionRepository = new SPKTCore.Core.DataAccess.Impl.PermissionRepository(); _userSession = new UserSession(); _redirector = new Redirector(); _email = new Email(); _profileService = new ProfileService(); _webContext=new SPKTCore.Core.Impl.WebContext(); _friendService = new SPKTCore.Core.Impl.FriendService(); //friendInvitation = new FriendInvitation(); }
public UserService(IConfigService configService, IUserRepository userRepository, IPermissionRepository permissionRepository, IAuthTokenRepository authTokenRepository, INotificationService notificationService) { _configService = configService; _userRepository = userRepository; _permissionRepository = permissionRepository; _authTokenRepository = authTokenRepository; _notificationService = notificationService; }
public void Init(IRegister view) { _view = view; _accountRepository = ObjectFactory.GetInstance<IAccountRepository>(); _permissionRepository = ObjectFactory.GetInstance<IPermissionRepository>(); _termRepository = ObjectFactory.GetInstance<ITermRepository>(); _accountService = ObjectFactory.GetInstance<IAccountService>(); _webContext = ObjectFactory.GetInstance<IWebContext>(); _email = ObjectFactory.GetInstance<IEmail>(); _configuration = ObjectFactory.GetInstance<IConfiguration>(); _view.LoadTerms(_termRepository.GetCurrentTerm()); }
// public IUnitOfWork UnitOfWork { get; set; } public RoleService(IRoleRepository roleRepository, IModulePermissionRepository modulePermissionRepository, IRoleModulePermissionRepository roleModulePermissionRepository, IModuleRepository moduleRepository, IPermissionRepository permissionRepository, IUserRoleRepository userRoleRepository) { _roleRepository = roleRepository; _modulePermissionRepository = modulePermissionRepository; _roleModulePermissionRepository = roleModulePermissionRepository; _moduleRepository = moduleRepository; _permissionRepository = permissionRepository; _userRoleRepository = userRoleRepository; }
public AccountService() { //TODO: CẤP THIẾT hic hic //_accountRepository = ObjectFactory.GetInstance<IAccountRepository>(); //_permissionRepository = ObjectFactory.GetInstance<IPermissionRepository>(); //_userSession = ObjectFactory.GetInstance<IUserSession>(); //_redirector = ObjectFactory.GetInstance<IRedirector>(); //_email = ObjectFactory.GetInstance<IEmail>(); _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _permissionRepository = new SPKTCore.Core.DataAccess.Impl.PermissionRepository(); _userSession = new UserSession(); _redirector = new Redirector(); _email = new Email(); _profileService = new ProfileService(); }
/// <summary> /// The method that matches incoming number to a collection of permissions /// </summary> /// <param name="value">The number of bit-vector that comes and needs to be converted to list</param> /// <param name="repository">A layer to get permissions from database</param> /// <returns>A collection of permissions</returns> private static IEnumerable<Permission> MatchPermissions(int value, IPermissionRepository repository) { AccessRight vector = (AccessRight)value; var accessRights = vector .ToString() .Split(',') .Select(x => Enum.Parse(typeof(AccessRight), x)) .Cast<AccessRight>(); var result = repository.Get(new List<Expression<Func<Permission, bool>>>() { perm => accessRights.Contains(perm.AccessRights) }); return result; }
public override void Initialize() { base.Initialize(); var context = Factory.Get(); Uow = new AuthUnitOfWork(Factory); PermissionRepository = new PermissionRepository(Factory); GroupRepository = new GroupRepository(Factory); AccountRepository = new AccountRepository(Factory); UserRepository = new UserRepository(IdentityUserStore, Factory); AuthorizationService = new AuthorizationService(GroupRepository, PermissionRepository, AccountRepository, Uow); }
public SettingsRepositories(ISession session) { this.session = session; this.welderRepo = new WelderRepository(session); this.pipeTestRepo = new PipeTestRepository(session); this.pipeSizeTypeRepo = new MillPipeSizeTypeRepository(session); this.projectRepo = new ProjectRepository(session); this.manufacturerRepo = new PlateManufacturerRepository(session); this.inspectorRepo = new InspectorRepository(session); this.categoryRepo = new CategoryRepository(session); this.jointRepo = new JointOperationRepository(session); this.userRepo = new UserRepository(session); this.roleRepo = new RoleRepository(session); this.permissionRepo = new PermissionRepository(session); this.componentTypeRepo = new ComponentTypeRepository(session); this.certificateTypeRepo = new InspectorCertificateTypeRepository(session); this.seamTypeRepo = new SeamTypeRepository(session); }
private static HomeController GetHomeController(IPermissionRepository repository) { HomeController controller = new HomeController(repository); controller.ControllerContext = new ControllerContext() { Controller = controller, RequestContext = new RequestContext(new MockHttpContext(), new RouteData()) }; return controller; }
public HomeController(IPermissionRepository repository) { _repository = repository; }
//构造函数注入 public PermissionController(IPermissionRepository permissionRepository) { PermissionRepository = permissionRepository; }
public MySqlPermissionPoller(IConfiguration configuration, IPermissionRepository permissionRepository, ILogger <MySqlPermissionPoller> logger) { this.configuration = configuration; _permissionRepository = permissionRepository; _logger = logger; }
public TokenController(IUserService service, IOptions <AuthOptions> authOptionsAccessor, IPermissionRepository permissionRepository) { _service = service; _authOptions = authOptionsAccessor.Value; _permissionRepository = permissionRepository; }
public ButtonService(IMapper mapper, IUnitOfWork <AdminDbContext> uow, IButtonRepository buttonRepository, IMenuRepository menuRepository, IRoleMenuButtonRepository roleMenuButtonRepository, IPermissionRepository permissionRepository, IButtonPermissionRepository buttonPermissionRepository, IAccountRoleRepository accountRoleRepository, IAccountService accountService) { _mapper = mapper; _uow = uow; _buttonRepository = buttonRepository; _menuRepository = menuRepository; _roleMenuButtonRepository = roleMenuButtonRepository; _permissionRepository = permissionRepository; _buttonPermissionRepository = buttonPermissionRepository; _accountRoleRepository = accountRoleRepository; _accountService = accountService; }
public PermissionService(IPermissionRepository permissionRepository) : base(permissionRepository) { _permissionRepository = permissionRepository; }
public SystemAdministratorService(IChurchRepository churchRepository, IPermissionRepository permissionRepository) { _churchRepository = churchRepository; _permissionRepository = permissionRepository; }
public PermissionService(IPermissionRepository permissionRepository, ICategoryPermissionForRoleRepository categoryPermissionForRoleRepository) { _permissionRepository = permissionRepository; _categoryPermissionForRoleRepository = categoryPermissionForRoleRepository; }
public EntitySubdivisionPermissionModel(IUnitOfWork uow, Subdivision subdivision, PermissionListViewModel permissionListViewModel, IPermissionRepository permissionRepository) { PermissionListViewModel = permissionListViewModel ?? throw new NullReferenceException(nameof(permissionListViewModel)); this.subdivision = subdivision; this.uow = uow; ExtensionStore = PermissionListViewModel.PermissionExtensionStore; var permissionList = permissionRepository.GetAllSubdivisionEntityPermissions(uow, subdivision.Id, ExtensionStore); originalPermissionList = permissionList.ToList(); PermissionListViewModel.PermissionsList = new GenericObservableList <IPermissionNode>(permissionList.OfType <IPermissionNode>().ToList()); PermissionListViewModel.PermissionsList.ElementRemoved += (aList, aIdx, aObject) => DeletePermission(aObject as SubdivisionPermissionNode); originalTypeOfEntityList = TypeOfEntityRepository.GetAllSavedTypeOfEntity(uow).ToList(); //убираем типы уже загруженные в права foreach (var item in originalPermissionList) { if (originalTypeOfEntityList.Contains(item.TypeOfEntity)) { originalTypeOfEntityList.Remove(item.TypeOfEntity); } } SortTypeOfEntityList(); ObservableTypeOfEntitiesList = new GenericObservableList <TypeOfEntity>(originalTypeOfEntityList); }
public PermissionTableViewComponent(RoleManager <IdentityRole> roleManager, IPermissionRepository repo) { _roleManager = roleManager; _permissionRepository = repo; }
public MenuService(IMenuRepository menuRepository, IMenuPermissionRepository menuPermissionRepository, IMapper mapper, IRoleMenuRepository roleMenuRepository, IPermissionRepository permissionRepository, IButtonRepository buttonRepository, IRoleMenuButtonRepository roleMenuButtonRepository, IAccountRoleRepository accountRoleRepository, IAccountService accountService, IButtonPermissionRepository buttonPermissionRepository) { _menuRepository = menuRepository; _menuPermissionRepository = menuPermissionRepository; _mapper = mapper; _roleMenuRepository = roleMenuRepository; _buttonRepository = buttonRepository; _roleMenuButtonRepository = roleMenuButtonRepository; _accountRoleRepository = accountRoleRepository; _accountService = accountService; _buttonPermissionRepository = buttonPermissionRepository; }
public PermissionAppService(IPermissionRepository permissionRepository) { this._permissionRepository = permissionRepository; }
public UserController(ISysAdminRepository SysAdminRepository, IUserRoleRepository userRoleRepository, IRoleRepository roleRepository, IUser user, IModuleRepository moduleRepository, IPermissionRepository permissionRepository, IRoleModulePermissionRepository roleModulePermissionRepository, IUser iUser, ITeacherRepository iTeacherRepository) { _SysAdminRepository = SysAdminRepository; _userRoleRepository = userRoleRepository; _roleRepository = roleRepository; _user = user; this.moduleRepository = moduleRepository; this.permissionRepository = permissionRepository; this.roleModulePermissionRepository = roleModulePermissionRepository; this._iTeacherRepository = iTeacherRepository; this._iUser = iUser; }
public PermissionService(IPermissionRepository permissionRepository, ICategoryPermissionForRoleRepository categoryPermissionForRoleRepository) { _permissionRepository = permissionRepository; _categoryPermissionForRoleRepository = categoryPermissionForRoleRepository; }
public ModuleDefinitionRepository(MasterDBContext context, IMemoryCache cache, IPermissionRepository permissions) { _db = context; _cache = cache; _permissions = permissions; }
/** * <summary>Método constructor</summary> * <param name="permissionRepository">Corresponde al tipo de interfaz de tipo IPermissionRepository</param> */ public PermissionService(IPermissionRepository permissionRepository):base(permissionRepository) { this.permissionRepository = permissionRepository; }//Fin del método
public PermissionHandler(IHttpContextAccessor HttpContextAccessor, IPermissionRepository Permissions) { this.HttpContextAccessor = HttpContextAccessor; this.Permissions = Permissions; }
public UserPermissions(IPermissionRepository permissions, IHttpContextAccessor accessor) { _permissions = permissions; _accessor = accessor; }
public RoleConfigurationValidator(IRoleConfigurationRepository roleConfigurationRepository, IPermissionAccessLevelRepository permissionAccessLevelRepository, IRoleRepository roleRepository, IPermissionRepository permissionRepository, IAccessLevelRepository accessLevelRepository) { _roleConfigurationRepository = roleConfigurationRepository; _permissionAccessLevelRepository = permissionAccessLevelRepository; _roleRepository = roleRepository; _permissionRepository = permissionRepository; _accessLevelRepository = accessLevelRepository; RuleSet("Base", () => { RuleFor(roleConfiguration => roleConfiguration.RoleId).NotNull().NotEmpty(); RuleFor(roleConfiguration => roleConfiguration.PermissionId).NotNull().NotEmpty(); RuleFor(roleConfiguration => roleConfiguration.AccessLevelId).NotNull().NotEmpty(); Custom(CheckIsAccessLevelBelongToPermission); Custom(ReferencesValidate); }); RuleSet("Create", () => { Custom(CreateRoleConfigurationValidate); }); RuleSet("Update", () => { Custom(UpdateRoleConfigurationValidate); }); }
public ProjectPermissionsPermissionHandler(IClaimsIdentityService claimsIdentityService, IPermissionRepository permissionRepository) { fClaimsIdentityService = claimsIdentityService; fPermissionRepository = permissionRepository; }
public AuthorizationService(IPermissionRepository permissionRepository) { PermissionRepository = permissionRepository; }
public FileRepository(TenantDBContext context, IPermissionRepository Permissions) { db = context; this.Permissions = Permissions; }
public ScopesAuthoriser(IPermissionRepository permissionRepository, IClaimsParser claimsParser) { _permissionRepository = permissionRepository; _claimsParser = claimsParser; }
public AdminController(IAdminRepository repo, IPermissionRepository permission) { _repo = repo; _permission = permission; }
protected override void SharedContext() { _user = new User(); PermissionRepository = MockRepository.GenerateMock <IPermissionRepository>(); }
public PageController(IPageRepository pages, IModuleRepository modules, IPageModuleRepository pageModules, IPermissionRepository permissionRepository, ISettingRepository settings, IUserPermissions userPermissions, ITenantManager tenantManager, ISyncManager syncManager, ILogManager logger) { _pages = pages; _modules = modules; _pageModules = pageModules; _permissionRepository = permissionRepository; _settings = settings; _userPermissions = userPermissions; _syncManager = syncManager; _logger = logger; _alias = tenantManager.GetAlias(); }
public BucketAuthorizeHostedService(IConfiguration configuration, IPermissionRepository permissionRepository) { this.configuration = configuration; _permissionRepository = permissionRepository; }
public IdentityWithAdditionalClaimsProfileService(UserManager <UserModel> userManager, IUserClaimsPrincipalFactory <UserModel> claimsFactory, ILogger <IdentityWithAdditionalClaimsProfileService> logger, IProfileRepository profileRepository, IApplicationDataPolicyRepository applicationDataPolicyRepository, IPermissionRepository permissionRepository, ITeamRepository teamRepository) { _userManager = userManager; _claimsFactory = claimsFactory; Logger = logger; this.profileRepository = profileRepository; this.applicationDataPolicyRepository = applicationDataPolicyRepository; this.permissionRepository = permissionRepository; this.teamRepository = teamRepository; }
public HierarchicalPresetPermissionValidator(IEmployeeRepository employeeRepository, IPermissionRepository permissionRepository) { this.employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository)); this.permissionRepository = permissionRepository ?? throw new ArgumentNullException(nameof(permissionRepository)); }
public ProjectRoleManager(IPermissionRepository permissionRepository, IProjectRepository projectRepository, IMembershipRepository membershipRepository) { _permissionRepository = DIHelper.VerifyParameter(permissionRepository); _projectRepository = DIHelper.VerifyParameter(projectRepository); _membershipRepository = DIHelper.VerifyParameter(membershipRepository); }
public PermissionController(ILogger <PermissionController> logger, IPermissionRepository permissionRepository) { this.logger = logger; this.permissionRepository = permissionRepository; }
// public IUnitOfWork UnitOfWork { get; set; } public PermissionService(IPermissionRepository permissionRepository) { _permissionRepository = permissionRepository; }
public PermissionServices(IPermissionRepository dal) { this.dal = dal; base.baseDal = dal; }
public PermissionCreateService(IPermissionRepository permissionRepository) { this._permissionRepository = permissionRepository; }
public PermissionProvider( IPermissionRepository repository ) { _repository = repository; }
public MenuController(IServiceProvider serviceProvider, LogOperateRecordService operateLog, IUnitOfWork unitOfWork, IPermissionRepository permissionRepository) : base(serviceProvider, operateLog, unitOfWork, permissionRepository) { }
public AccountService(ICacheHandler cache, IMapper mapper, IAccountRepository accountRepository, IAccountRoleRepository accountRoleRepository, IMenuRepository menuRepository, IRoleRepository roleRepository, IButtonRepository buttonRepository, IPermissionRepository permissionRepository, DrawingHelper drawingHelper, ISystemService systemService, IServiceProvider serviceProvider, IAccountConfigRepository accountConfigRepository, AdminDbContext dbContext) { _cache = cache; _mapper = mapper; _accountRepository = accountRepository; _accountRoleRepository = accountRoleRepository; _menuRepository = menuRepository; _roleRepository = roleRepository; _buttonRepository = buttonRepository; _permissionRepository = permissionRepository; _drawingHelper = drawingHelper; _systemService = systemService; _serviceProvider = serviceProvider; _accountConfigRepository = accountConfigRepository; _dbContext = dbContext; }