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

Reintroduce can_rename?

Klaus Zanders1ba1481d5679
diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb
index 4f6a8cc28b9..5cf1928edba 100644
--- a/app/components/projects/index_page_header_component.rb
+++ b/app/components/projects/index_page_header_component.rb
@@ -82,7 +82,17 @@ class Projects::IndexPageHeaderComponent < ApplicationComponent
end
end
- alias can_rename? can_save?
+ def can_rename?
+ return false unless current_user.logged?
+ return false unless query.persisted?
+ return false if query.changed?
+
+ if query.public?
+ current_user.allowed_globally?(:manage_public_project_queries)
+ else
+ query.user == current_user
+ end
+ end
def can_publish?
OpenProject::FeatureDecisions.project_list_sharing_active? &&