mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
action and permission for dialog to show value'n'comment
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user