コード例 #1
0
 public SectionController()
 {
     sectionService = ServiceLocator.Current.GetInstance<ISectionService>();
     sectionLocaleService = ServiceLocator.Current.GetInstance<ISectionLocaleService>();
     permissionService = ServiceLocator.Current.GetInstance<IPermissionCommonService>();
     permissionsHelper = ServiceLocator.Current.GetInstance<IPermissionsHelper>();
 }
コード例 #2
0
 /// <summary>
 /// public ctor - will generally just be used for unit testing
 /// </summary>
 /// <param name="contentService"></param>
 /// <param name="mediaService"></param>
 /// <param name="contentTypeService"></param>
 /// <param name="dataTypeService"></param>
 /// <param name="fileService"></param>
 /// <param name="localizationService"></param>
 /// <param name="packagingService"></param>
 /// <param name="entityService"></param>
 /// <param name="relationService"></param>
 /// <param name="sectionService"></param>
 /// <param name="treeService"></param>
 /// <param name="tagService"></param>
 public ServiceContext(
     IContentService contentService, 
     IMediaService mediaService, 
     IContentTypeService contentTypeService, 
     IDataTypeService dataTypeService, 
     IFileService fileService, 
     ILocalizationService localizationService, 
     PackagingService packagingService, 
     IEntityService entityService,
     IRelationService relationService,
     ISectionService sectionService,
     IApplicationTreeService treeService,
     ITagService tagService)
 {
     _tagService = new Lazy<ITagService>(() => tagService);     
     _contentService = new Lazy<IContentService>(() => contentService);        
     _mediaService = new Lazy<IMediaService>(() => mediaService);
     _contentTypeService = new Lazy<IContentTypeService>(() => contentTypeService);
     _dataTypeService = new Lazy<IDataTypeService>(() => dataTypeService);
     _fileService = new Lazy<IFileService>(() => fileService);
     _localizationService = new Lazy<ILocalizationService>(() => localizationService);
     _packagingService = new Lazy<PackagingService>(() => packagingService);
     _entityService = new Lazy<IEntityService>(() => entityService);
     _relationService = new Lazy<IRelationService>(() => relationService);
     _sectionService = new Lazy<ISectionService>(() => sectionService);
     _treeService = new Lazy<IApplicationTreeService>(() => treeService);
 }
コード例 #3
0
 public SectionController(ISectionService SectionService, ILookupService lookupService, IClassService ClassService)
     : base()
 {
     this._SectionService = SectionService;
     this._lookupService = lookupService;
     this._ClassService = ClassService;
 }
コード例 #4
0
        public StudentsController(IStudentService StudentsService, ILookupService lookupService,
            IStudentsParentService StudentsParentService, IStudentsMedicalService StudentsMedicalService,
            IStudentsTransportService StudentsTransportService, IStudentsDocsService StudentsDocsService,
            IAcademicYearService AcademicYearService, IClassService ClassService,
            ISectionService SectionService, IBatchService BatchService, IAreaService AreaService,
            IStudentsAttendanceService StudentsAttendanceService, IStudentsClassService StudentsClassService)
            : base()
        {
            this._StudentService = StudentsService;
            this._StudentsParentService = StudentsParentService;
            this._StudentsMedicalService = StudentsMedicalService;
            this._StudentsTransportService = StudentsTransportService;
            this._StudentsDocsService = StudentsDocsService;
            this._StudentsClassService = StudentsClassService;

            this._AcademicYearService = AcademicYearService;
            this._ClassService = ClassService;
            this._SectionService = SectionService;
            this._BatchService = BatchService;
            this._AreaService = AreaService;

            this._lookupService = lookupService;

            this._StudentsAttendanceService = StudentsAttendanceService;
        }
        public void Init()
        {
            // this.userRepo = TestObjectFactory.GetUsersRepository();
            this.sectionsRepo = TestObjectFactory.GetSectionsRepository();

            this.sectionsService = new SectionService(this.sectionsRepo);
        }
コード例 #6
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public BaseSectionController(
			BaseControllerArgs args, 
			IClassroomService classroomService,
			ISectionService sectionService) 
				: base(args, classroomService)
		{
			SectionService = sectionService;
		}
コード例 #7
0
 public AdminController(IUserService userService,
     ISectionService sectionService, IRequestService requestService, ICategoryService categoryService)
 {
     _userService = userService;
     _sectionService = sectionService;
     _requestService = requestService;
     _categoryService = categoryService;
 }
コード例 #8
0
 public ProfilesApiController(ISectionService SectionService,
                                  IUserDataService userDataService, 
                                  IOfficeHourServices OfficeHourServices)
 {
     _sectionService = SectionService;
     _officeHours = OfficeHourServices;
     _userDataService = userDataService;
 }
 public TopicsController(ITopicsServices topics, IZipFilesService zipFiles, ISectionService sections, IExamplesService examples, IUsersService usersService, ICloudStorageService drive)
 {
     this.topics = topics;
     this.sections = sections;
     this.examples = examples;
     this.zipFiles = zipFiles;
     this.users = usersService;
     this.cloudStorage = drive;
 }
コード例 #10
0
 public PagesController(INodeService nodeService, ITemplateService templateService, IFileService fileService, ISectionService sectionService, IModelValidator<Node> modelValidator, ModuleLoader moduleLoader)
 {
     _nodeService = nodeService;
     _templateService = templateService;
     _fileService = fileService;
     _sectionService = sectionService;
     this.ModelValidator = modelValidator;
     _moduleLoader = moduleLoader;
 }
        //private ActionCollection _inboundActions;
        //private ActionCollection _outboundActions;

        public CuyAccordionModule(ICommonDao commonDao, ICuyAccordionDao cuyAccordionDao, ISectionService sectionService)
        {
            this._commonDao = commonDao;
            this._cuyAccordionDao = cuyAccordionDao;
            this._sectionService = sectionService;

            //InitInboundActions();
            //InitOutboundActions();
        }
コード例 #12
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public StudentController(
			BaseControllerArgs args,
			IClassroomService classroomService,
			ISectionService sectionService,
			IUserService userService)
			: base(args, classroomService, sectionService)
		{
			UserService = userService;
		}
コード例 #13
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public AdminBasePage()
        {
            this._activeNode = null;

            this._siteService = Container.Resolve<ISiteService>();
            this._nodeService = Container.Resolve<INodeService>();
            this._sectionService = Container.Resolve<ISectionService>();
            this._moduleLoader = Container.Resolve<ModuleLoader>();
        }
コード例 #14
0
 public AdminWebService()
 {
     this._cuyahogaContainer = IoC.Container;
         this._commonDao = CuyahogaContainer.Resolve<ICommonDao>();
         this._siteService = CuyahogaContainer.Resolve<ISiteService>();
         this._sectionService = CuyahogaContainer.Resolve<ISectionService>();
         this._nodeService = CuyahogaContainer.Resolve<INodeService>();
         this._userService = CuyahogaContainer.Resolve<IUserService>();
 }
コード例 #15
0
 public SectionsController(ISectionService sectionService, INodeService nodeService, ModuleLoader moduleLoader, 
     SectionModelValidator modelValidator, ITemplateService templateService, IModuleTypeService moduleTypeService)
 {
     _sectionService = sectionService;
     _templateService = templateService;
     _moduleTypeService = moduleTypeService;
     _nodeService = nodeService;
     _moduleLoader = moduleLoader;
     ModelValidator = modelValidator;
 }
        //private ActionCollection _inboundActions;
        //private ActionCollection _outboundActions;

        public CuyaLightBoxModule(ICommonDao commonDao, ICuyaLightBoxDao cuyaLightBoxDao, IFileService fileService, ISectionService sectionService)
        {
            this._commonDao = commonDao;
            this._cuyaLightBoxDao = cuyaLightBoxDao;
            this._fileService = fileService;
            this._sectionService = sectionService;
            //InitInboundActions();
            //InitOutboundActions();

        }
コード例 #17
0
 public ModeratorController(ISectionService sectionService, 
     ICategoryService categoryService, IRequestService requestService,
     ILotImageService lotRequestService, ILotService lotService)
 {
     _sectionService = sectionService;
     _categoryService = categoryService;
     _requestService = requestService;
     _lotRequestService = lotRequestService;
     _lotService = lotService;
 }
        public void Init()
        {
            this.controller = MyWebApi.Controller<SectionsController>()
                .WithResolvedDependencyFor(TestObjectFactory.GetSectionService());

            this.controllerWithMockedNotFoundService = MyWebApi.Controller<SectionsController>()
                            .WithResolvedDependencyFor(TestObjectFactory.GetSectionServiceNotFoundMock());

            this.sectionsService = TestObjectFactory.GetSectionService();
        }
コード例 #19
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public CheckpointController(
			BaseControllerArgs args,
			IClassroomService classroomService,
			ISectionService sectionService,
			IProjectService projectService,
			ICheckpointService checkpointService)
				: base(args, classroomService, projectService)
		{
			SectionService = sectionService;
			CheckpointService = checkpointService;
		}
コード例 #20
0
 public LotController(ICategoryService categoryService, ISectionService sectionService,
     ILotService lotService, IUserService userService, ILotImageService lotRequestService,
     IBidService bidService)
 {
     _sectionService = sectionService;
     _categoryService = categoryService;
     _lotService = lotService;
     _userService = userService;
     _lotImageService = lotRequestService;
     _bidService = bidService;
 }
コード例 #21
0
        /// <summary>
        /// Default constructor calls base constructor with parameters for templatecontrol, 
        /// templatepath and stylesheet.
        /// </summary>
        public ModuleAdminBasePage()
            : base("ModuleAdminTemplate.ascx", "~/Controls/", "~/Admin/Css/Admin.css")
        {
            this._node = null;
            this._section = null;

            this._moduleLoader = Container.Resolve<ModuleLoader>();
            this._searchService = Container.Resolve<ISearchService>();
            this._sectionService = Container.Resolve<ISectionService>();
            this._nodeService = Container.Resolve<INodeService>();
        }
コード例 #22
0
        public EnquiryController(IEnquiryService EnquiryService, ILookupService lookupService,
            IAcademicYearService AcademicYearService, IClassService ClassService,
            ISectionService SectionService)
            : base()
        {
            this._EnquiryService = EnquiryService;
            this._lookupService = lookupService;

            this._AcademicYearService = AcademicYearService;
            this._ClassService = ClassService;
            this._SectionService = SectionService;
        }
コード例 #23
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public AdminBasePage()
        {
            this._activeNode = null;

            this._siteService = Container.Resolve<ISiteService>();
            this._userService = Container.Resolve<IUserService>();
            this._nodeService = Container.Resolve<INodeService>();
            this._sectionService = Container.Resolve<ISectionService>();
            this._moduleTypeService = Container.Resolve<IModuleTypeService>();
            this._moduleLoader = Container.Resolve<ModuleLoader>();
            this._templateService = Container.Resolve<ITemplateService>();
            this._fileService = Container.Resolve<IFileService>();
        }
コード例 #24
0
        public ComplaintController(IComplaintService ComplaintService, ILookupService lookupService,
            IAcademicYearService AcademicYearService, IClassService ClassService,
            ISectionService SectionService, IStudentService StudentService)
            : base()
        {
            this._ComplaintService = ComplaintService;
            this._lookupService = lookupService;

            this._AcademicYearService = AcademicYearService;
            this._ClassService = ClassService;
            this._SectionService = SectionService;
            this._StudentService = StudentService;
        }
コード例 #25
0
 public ReportController(IExamService ExamService, ILookupService lookupService, IExamSubjectsService IExamSubjectsService, IExamMarksDetailIsService IExamMarksDetailIsService, IAcademicYearService AcademicYearService, IClassService ClassService,
     ISectionService SectionService, IExamMarksService IExamMarksService)
     : base()
 {
     this._ExamService = ExamService;
     this._lookupService = lookupService;
     this._IExamSubjectsService = IExamSubjectsService;
     _IExamMarksDetailIsService = IExamMarksDetailIsService;
     this._AcademicYearService = AcademicYearService;
     this._ClassService = ClassService;
     this._SectionService = SectionService;
     _IExamMarksService = IExamMarksService;
 }
コード例 #26
0
        public static bool AuthorizeAccess(IDashboardControl dashboardTab, IUser user, ISectionService sectionService)
        {
            if (user.Id.ToString() == Constants.System.Root.ToInvariantString())
            {
                return true;
            }

            var denyTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Deny).ToArray();
            var grantedTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.Grant).ToArray();
            var grantedBySectionTypes = dashboardTab.AccessRights.Rules.Where(x => x.Action == AccessType.GrantBySection).ToArray();

            return CheckUserAccessByRules(user, sectionService, denyTypes, grantedTypes, grantedBySectionTypes);
        }
コード例 #27
0
ファイル: PageEngine.cs プロジェクト: xwyangjshb/cuyahoga
        /// <summary>
        /// Default constructor.
        /// </summary>
        public PageEngine()
        {
            this._activeNode = null;
            this._activeSection = null;
            this._templateControl = null;
            this._shouldLoadContent = true;

            // Get services from the container. Ideally, it should be possible to register the aspx page in the container
            // to automatically resolve dependencies but there were memory issues with registering pages in the container.
            this._moduleLoader = Container.Resolve<ModuleLoader>();
            this._nodeService = Container.Resolve<INodeService>();
            this._siteService = Container.Resolve<ISiteService>();
            this._sectionService = Container.Resolve<ISectionService>();
        }
コード例 #28
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public AssignmentController(
			BaseControllerArgs args,
			IClassroomService classroomService,
			IAssignmentService assignmentService,
			ISectionService sectionService,
			IQuestionService questionService,
			IUserService userService)
				: base(args, classroomService)
		{
			AssignmentService = assignmentService;
			SectionService = sectionService;
			QuestionService = questionService;
			UserService = userService;
		}
コード例 #29
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public UserController(
			BaseControllerArgs args,
			IIdentityProvider identityProvider,
			IUserService userService, 
			IClassroomService classroomService, 
			ISectionService sectionService,
			WebAppHost webAppHost) 
				: base(args)
		{
			_userService = userService;
			_identityProvider = identityProvider;
			_classroomService = classroomService;
			_sectionService = sectionService;
			_webAppHost = webAppHost;
		}
コード例 #30
0
        public static bool CheckUserAccessByRules(IUser user, ISectionService sectionService, IAccessItem[] denyTypes, IAccessItem[] grantedTypes, IAccessItem[] grantedBySectionTypes)
        {
            var allowedSoFar = false;

            //Check if this item as any grant-by-section arguments, if so check if the user has access to any of the sections approved, if so they will
            // be allowed to see it (so far)
            if (grantedBySectionTypes.Any())
            {
                var allowedApps = sectionService.GetAllowedSections(Convert.ToInt32(user.Id))
                                                .Select(x => x.Alias)
                                                .ToArray();

                var allApprovedSections = grantedBySectionTypes.SelectMany(g => g.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray();
                if (allApprovedSections.Any(allowedApps.Contains))
                {
                    allowedSoFar = true;
                }
            }

            //Check if this item as any grant arguments, if so check if the user is one of the user types approved, if so they will
            // be allowed to see it (so far)
            if (grantedTypes.Any())
            {
                var allApprovedUserTypes = grantedTypes.SelectMany(g => g.Value.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)).ToArray();
                if (allApprovedUserTypes.InvariantContains(user.UserType.Alias))
                {
                    allowedSoFar = true;
                }
            }
            else
            {
                //if there are not explicit grant types then everyone is allowed so far and we'll only disallow on a deny basis
                allowedSoFar = true;
            }

            //Check if this item as any deny arguments, if so check if the user is one of the user types approved, if so they will
            // be denied to see it no matter what
            if (denyTypes.Any())
            {
                var allDeniedUserTypes = denyTypes.SelectMany(g => g.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray();
                if (allDeniedUserTypes.InvariantContains(user.UserType.Alias))
                {
                    allowedSoFar = false;
                }
            }

            return allowedSoFar;
        }
コード例 #31
0
 public EmployeeController(IEmployeeProfileService employeeService, IJobService jobService, IOfferService offerService, ISectionService sectionService, ISkillService skillService, ICommitProvider commitProvider)
 {
     _employeeService = employeeService;
     _jobService      = jobService;
     _offerService    = offerService;
     _sectionService  = sectionService;
     _skillService    = skillService;
     _commitProvider  = commitProvider;
 }
コード例 #32
0
 public SectionsController(ISectionService sectionService)
 {
     this.sectionService = sectionService;
 }
コード例 #33
0
 public CoursesController(ICourseService courseService, ISectionService sectionService)
 {
     this.courseService  = courseService;
     this.sectionService = sectionService;
 }
コード例 #34
0
 public SectionItemService(IPointExUow uow, ISectionService sectionService, IClock clock)
 {
     _sectionService = sectionService;
     _clock          = clock;
     Uow             = uow;
 }
コード例 #35
0
ファイル: DataSeeder.cs プロジェクト: mashtoe/elearner-api
 public DataSeeder(IAuthService authService, ICourseService courseService, IUserService userService, ICategoryService categoryService, ISectionService sectionService, ILessonService lessonService)
 {
     _authService   = authService;
     _courseService = courseService;
     _userService   = userService;
     _catService    = categoryService;
     _secService    = sectionService;
     _lesService    = lessonService;
 }
コード例 #36
0
 public HomeController(ISectionService sectionService, IPostService postService, IUserService userService)
 {
     this.sectionService = sectionService;
     this.postService    = postService;
     this.userService    = userService;
 }
コード例 #37
0
 public SectionController(ISectionService sectionService)
 {
     _sectionService = sectionService;
 }
コード例 #38
0
 public DashboardService(ISectionService sectionService, DashboardCollection dashboardCollection, ILocalizedTextService localizedText)
 {
     _sectionService      = sectionService ?? throw new ArgumentNullException(nameof(sectionService));
     _dashboardCollection = dashboardCollection ?? throw new ArgumentNullException(nameof(dashboardCollection));
     _localizedText       = localizedText ?? throw new ArgumentNullException(nameof(localizedText));
 }
コード例 #39
0
 public SectionBaseController(IWebPageService webPageService, ISectionService sectionService, IWebHelper webHelper)
 {
     _webPageService = webPageService;
     _sectionService = sectionService;
     _webHelper      = webHelper;
 }
コード例 #40
0
 public ConferenceController(ISectionService service)
 {
     _service = service;
     _logger  = LogManager.GetCurrentClassLogger();
 }
コード例 #41
0
 public SectionsController(ISectionService iSectionService, IMapper imapper)
 {
     _iSectionService = iSectionService;
     _iMapper         = imapper;
 }
コード例 #42
0
 public ForumController(ISectionService service)
 {
     _sectionService = service;
 }
コード例 #43
0
 public SectionController(ISectionService SectionService)
 {
     _SectionService = SectionService;
 }
コード例 #44
0
 public HomeController(ILogger <HomeController> logger, ICourseService courseService, ILessonService lessonService,
                       ITestService testService, IQuestionService questionService, ISectionService sectionService, IUserService userService,
                       ICertificateService certificateService)
 {
     this.logger             = logger;
     this.courseService      = courseService;
     this.lessonService      = lessonService;
     this.testService        = testService;
     this.questionService    = questionService;
     this.sectionService     = sectionService;
     this.userService        = userService;
     this.certificateService = certificateService;
 }
コード例 #45
0
 public static bool AuthorizeAccess(IDashboardControl dashboardControl, IUser user, ISectionService sectionService)
 {
     return(CheckUserAccessByRules(user, sectionService, dashboardControl.AccessRights.Rules));
 }
コード例 #46
0
 public HomeController(IUser_InfoService Iuser_service, INewsService inewsService, ISectionService isectionService)
 {
     this.iuserService     = Iuser_service;
     this._InewsService    = inewsService;
     this._IsectionService = isectionService;
 }
コード例 #47
0
        public static bool CheckUserAccessByRules(IUser user, ISectionService sectionService, IEnumerable <IAccessRule> rules)
        {
            if (user.Id == Constants.Security.SuperUserId)
            {
                return(true);
            }

            var(denyRules, grantRules, grantBySectionRules) = GroupRules(rules);

            var hasAccess = true;

            string[] assignedUserGroups = null;

            // if there are no grant rules, then access is granted by default, unless denied
            // otherwise, grant rules determine if access can be granted at all
            if (grantBySectionRules.Length > 0 || grantRules.Length > 0)
            {
                hasAccess = false;

                // check if this item has any grant-by-section arguments.
                // if so check if the user has access to any of the sections approved, if so they will be allowed to see it (so far)
                if (grantBySectionRules.Length > 0)
                {
                    var allowedSections = sectionService.GetAllowedSections(user.Id).Select(x => x.Alias).ToArray();
                    var wantedSections  = grantBySectionRules.SelectMany(g => g.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray();

                    if (wantedSections.Intersect(allowedSections).Any())
                    {
                        hasAccess = true;
                    }
                }

                // if not already granted access, check if this item as any grant arguments.
                // if so check if the user is in one of the user groups approved, if so they will be allowed to see it (so far)
                if (hasAccess == false && grantRules.Any())
                {
                    assignedUserGroups = user.Groups.Select(x => x.Alias).ToArray();
                    var wantedUserGroups = grantRules.SelectMany(g => g.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray();

                    if (wantedUserGroups.Intersect(assignedUserGroups).Any())
                    {
                        hasAccess = true;
                    }
                }
            }

            if (!hasAccess || denyRules.Length == 0)
            {
                return(false);
            }

            // check if this item has any deny arguments, if so check if the user is in one of the denied user groups, if so they will
            // be denied to see it no matter what
            assignedUserGroups = assignedUserGroups ?? user.Groups.Select(x => x.Alias).ToArray();
            var deniedUserGroups = denyRules.SelectMany(g => g.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)).ToArray();

            if (deniedUserGroups.Intersect(assignedUserGroups).Any())
            {
                hasAccess = false;
            }

            return(hasAccess);
        }
コード例 #48
0
 public ThreadController(IMapper mapper, IThreadService threadService, ISectionService sectionService)
 {
     _mapper         = mapper;
     _threadService  = threadService;
     _sectionService = sectionService;
 }
コード例 #49
0
 public AdminSectionsApiController(ISectionService sectionService)
 {
     this._sectionService = sectionService;
 }
コード例 #50
0
ファイル: CatalogController.cs プロジェクト: agsyazilim/Ags
 public CatalogController(ICategoryService categoryService, ICatalogModelFactory catalogModelFactory, ISectionService sectionService)
 {
     _categoryService     = categoryService;
     _catalogModelFactory = catalogModelFactory;
     _sectionService      = sectionService;
 }
コード例 #51
0
 public UserController(IUserService iuserService, IuserGroupService iuserGroupService, ISectionService isectionService)
 {
     this._iuserService      = iuserService;
     this._iuserGroupService = iuserGroupService;
     this._isectionService   = isectionService;
 }
コード例 #52
0
 public PageController(ISectionService sectionService, IPageService pageService) : base(pageService)
 {
     _sectionService = sectionService;
     _pageService    = pageService;
 }
コード例 #53
0
 public SectionController(ISectionService sections)
 {
     _sections = sections;
 }
コード例 #54
0
 public GalleryService(IRepository <PhotoGallery> photoGalleryRepository, IRepository <PhotoGalleryMapping> photoGalleryMapRepository, ISectionService sectionService, IEventPublisher eventPublisher)
 {
     this._photoGalleryRepository    = photoGalleryRepository;
     this._photoGalleryMapRepository = photoGalleryMapRepository;
     this._sectionService            = sectionService;
     this._eventPublisher            = eventPublisher;
 }
コード例 #55
0
 public UserMapDefinition(ILocalizedTextService textService, IUserService userService, IEntityService entityService, ISectionService sectionService,
                          AppCaches appCaches, ActionCollection actions, IGlobalSettings globalSettings)
 {
     _sectionService = sectionService;
     _entityService  = entityService;
     _userService    = userService;
     _textService    = textService;
     _actions        = actions;
     _appCaches      = appCaches;
     _globalSettings = globalSettings;
 }
コード例 #56
0
 public ApplicationTreeController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor,
                                  ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger,
                                  IRuntimeState runtimeState, ITreeService treeService, ISectionService sectionService, UmbracoHelper umbracoHelper)
     : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
 {
     _treeService    = treeService;
     _sectionService = sectionService;
 }
コード例 #57
0
 public TestsController(ITestService testService, ISectionService sectionService, IQuestionService questionService)
 {
     this.testService     = testService;
     this.sectionService  = sectionService;
     this.questionService = questionService;
 }
コード例 #58
0
 public GallerySidebarModule(ISectionService sectionService)
 {
     _sectionService = sectionService;
 }
コード例 #59
0
 public SectionController(ISectionService service, ICourseService courseService, IUmsFacade umsFacade)
 {
     _service       = service;
     _courseService = courseService;
     _umsFacade     = umsFacade;
 }
コード例 #60
0
        //webpage
        public static WebPageModel ToModel(this WebPage entity, IWebPageService webPageService, ISectionService sectionService)
        {
            if (entity == null)
            {
                return(null);
            }

            bool userIsAdmin         = webPageService.IsAdminCurrentUser();
            bool userHasEditRights   = webPageService.HasEditRights(entity.Id);
            bool userHasCreateRights = webPageService.HasCreateRights(entity.Id);

            var model = new WebPageModel()
            {
                Id = entity.Id,
                //SidebarVisible = entity.SidebarEnabled,
                UserHasCreateRights = userHasCreateRights,
                AvailableSections   = sectionService.GetAvailableSections().Select(x => new SelectListItem {
                    Text = x
                })
            };

            foreach (var sectionEntity in entity.Sections)
            {
                var sm = GetSectionModel(sectionEntity);
                sm.Id                = sectionEntity.Id;
                sm.WebPage           = sectionEntity.WebPage;
                sm.UserHasEditRights = userHasEditRights;
                sm.UserIsAdmin       = userIsAdmin;
                model.Sections.Add(sm);
            }
            return(model);
        }