action and permission for dialog to show value'n'comment

This commit is contained in:
Ivan Kuchin
2026-01-30 16:11:15 +01:00
parent 5a89078072
commit b2e226cd6a
3 changed files with 13 additions and 0 deletions
@@ -35,6 +35,15 @@ class Overviews::ProjectCustomFieldsController < ApplicationController
before_action :find_project_custom_field
before_action :authorize
def show
respond_with_dialog(
Overviews::ProjectCustomFields::ShowDialogComponent.new(
project: @project,
project_custom_field: @custom_field
)
)
end
def edit
respond_with_dialog(
Overviews::ProjectCustomFields::EditDialogComponent.new(
@@ -54,6 +54,7 @@ module Overviews
OpenProject::AccessControl.permission(:view_project_attributes)
.controller_actions
.push(
"overviews/project_custom_fields/show",
"overviews/overviews/project_custom_fields_sidebar"
)
@@ -35,6 +35,9 @@ RSpec.describe Overviews::ProjectCustomFieldsController, "edit_project_attribute
type: :controller do
include PermissionSpecs
# render dialog displaying project attributes
check_permission_required_for("overviews/project_custom_fields#show", :view_project_attributes)
# render dialog with inputs for editing project attributes with edit_project permission
check_permission_required_for("overviews/project_custom_fields#edit", :edit_project_attributes)