Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

quick fixed drop service and fine tuned permission check on section actions

Jonas Jabari69cc9f1778c2
diff --git a/modules/meeting/app/components/meeting_sections/header_component.html.erb b/modules/meeting/app/components/meeting_sections/header_component.html.erb
index e10091e7286..6bc8d02bfaa 100644
--- a/modules/meeting/app/components/meeting_sections/header_component.html.erb
+++ b/modules/meeting/app/components/meeting_sections/header_component.html.erb
@@ -3,8 +3,8 @@
if @state == :show
flex_layout(justify_content: :space_between, align_items: :center) do |section_header_container|
section_header_container.with_column(flex_layout: true, align_items: :center) do |content_container|
- content_container.with_column(mr: @meeting_section.editable? ? 2 : 4) do
- if @meeting_section.editable?
+ content_container.with_column(mr: editable? ? 2 : 4) do
+ if editable?
render(Primer::OpenProject::DragHandle.new(classes: 'handle'))
end
end
@@ -14,7 +14,7 @@
end
end
end
- if @meeting_section.editable?
+ if editable?
section_header_container.with_column(flex_layout: true, justify_content: :flex_end) do |actions_container|
actions_container.with_column do
render(Primer::Alpha::ActionMenu.new(data: { test_selector: "meeting-section-action-menu" })) do |menu|
diff --git a/modules/meeting/app/components/meeting_sections/header_component.rb b/modules/meeting/app/components/meeting_sections/header_component.rb
index bfa42774353..eeea4ed7b56 100644
--- a/modules/meeting/app/components/meeting_sections/header_component.rb
+++ b/modules/meeting/app/components/meeting_sections/header_component.rb
@@ -56,6 +56,10 @@ module MeetingSections
}
end
+ def editable?
+ @meeting_section.editable? && User.current.allowed_in_project?(:manage_agendas, @meeting_section.project)
+ end
+
def first?
@first ||=
if @first_and_last.first
diff --git a/modules/meeting/app/services/meeting_agenda_items/drop_service.rb b/modules/meeting/app/services/meeting_agenda_items/drop_service.rb
index 38b7504c0cb..29fccee1d7a 100644
--- a/modules/meeting/app/services/meeting_agenda_items/drop_service.rb
+++ b/modules/meeting/app/services/meeting_agenda_items/drop_service.rb
@@ -44,7 +44,7 @@ module MeetingAgendaItems
service_call = perform_drop(service_call, params) if service_call.success?
- after_perform(service_call) if service_call.success?
+ # after_perform(service_call) if service_call.success? # TODO properly integrate after_perform_hook
service_call
end