public virtual ActionResult Show(String url)
        {
            var pageTemplate = pageService.FindTemplateByUrl(url);

            if (pageTemplate == null || !permissionService.IsAllowed((Int32)PageOperations.View, this.CorePrincipal(), typeof(PageTemplate), pageTemplate.Id, IsPageTemplateOwner(pageTemplate), PermissionOperationLevel.Object))
            {
                throw new HttpException((int)HttpStatusCode.NotFound, Translate("Messages.NotFound"));
            }

            return(View(MVC.Pages.Views.Show, PageHelper.BindPageViewModel(pageTemplate, this.CorePrincipal())));
        }
Beispiel #2
0
        public virtual ActionResult ShowAnswerDetails(long answerId)
        {
            var model = formWidgetAnswersService.Find(answerId);

            if (model == null || !permissionService.IsAllowed((int)FormsBuilderWidgetOperations.ViewAnswers, this.CorePrincipal(), typeof(FormsBuilderWidget), model.FormBuilderWidget.Id, IsFormOwner(model.FormBuilderWidget.Form), PermissionOperationLevel.ObjectType))
            {
                throw new HttpException(HttpContext.Translate("Messages.NotFound", ResourceHelper.GetControllerScope(this)));
            }

            return(View("FormAnswerDetails", model));
        }
        public virtual ActionResult Edit(long categoryId)
        {
            var category = categoryService.Find(categoryId);

            if (category == null || !permissionService.IsAllowed((Int32)CategoryOperations.View, this.CorePrincipal(), typeof(WebContentCategory), category.Id, IsCategoryOwner(category), PermissionOperationLevel.Object))
            {
                throw new HttpException((int)HttpStatusCode.NotFound, HttpContext.Translate("Messages.NotFound", ResourceHelper.GetControllerScope(this)));
            }

            bool allowManage = permissionService.IsAllowed((Int32)CategoryOperations.Manage, this.CorePrincipal(),
                                                           typeof(WebContentCategory), category.Id, IsCategoryOwner(category),
                                                           PermissionOperationLevel.Object);

            return(View("Edit", new CategoryViewModel {
                AllowManage = allowManage
            }.MapFrom(category)));
        }
        public virtual ActionResult Edit(long sectionId)
        {
            var section = sectionService.Find(sectionId);

            if (section == null || !permissionService.IsAllowed((Int32)SectionOperations.View, this.CorePrincipal(), typeof(Section), section.Id, IsSectionOwner(section), PermissionOperationLevel.Object))
            {
                throw new HttpException((int)HttpStatusCode.NotFound, HttpContext.Translate("Messages.NotFound", ResourceHelper.GetControllerScope(this)));
            }

            bool allowManage = permissionService.IsAllowed((Int32)SectionOperations.Manage, this.CorePrincipal(),
                                                           typeof(Section), section.Id, IsSectionOwner(section),
                                                           PermissionOperationLevel.Object);

            return(View("Edit", new SectionViewModel {
                AllowManage = allowManage
            }.MapFrom(section)));
        }
        public virtual ActionResult ShowPermissions(long formId)
        {
            var form = _formsService.Find(formId);

            if (form == null || !_permissionService.IsAllowed((Int32)FormOperations.Permissions, this.CorePrincipal(), typeof(Form), form.Id, IsFormOwner(form), PermissionOperationLevel.Object))
            {
                throw new HttpException((int)HttpStatusCode.NotFound, "Not Found");
            }

            return(View("Admin/FormPermissions", _permissionsHelper.BindPermissionsModel(form.Id, typeof(Form), false)));
        }
Beispiel #6
0
        public virtual ActionResult ShowPermissions(long formId)
        {
            var form = formsService.Find(formId);

            if (form == null || !permissionService.IsAllowed((Int32)FormOperations.Permissions, this.CorePrincipal(), typeof(Form), form.Id, IsFormOwner(form), PermissionOperationLevel.Object))
            {
                throw new HttpException((int)HttpStatusCode.NotFound, HttpContext.Translate("Notfound", ResourceHelper.GetControllerScope(this)) /*"Not Found"*/);
            }

            return(View("FormPermissions", permissionsHelper.BindPermissionsModel(form.Id, typeof(Form), false)));
        }