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

Use the `#editable?` method in Projects::IndexPageHeaderComponent

Klaus Zanders55491c4643a1
diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb
index 77b94c0b286..84ebd067913 100644
--- a/app/components/projects/index_page_header_component.rb
+++ b/app/components/projects/index_page_header_component.rb
@@ -77,11 +77,7 @@ class Projects::IndexPageHeaderComponent < ApplicationComponent
return false unless query.persisted?
return false unless query.changed?
- if query.public?
- current_user.allowed_globally?(:manage_public_project_queries)
- else
- query.user == current_user
- end
+ query.editable?
end
def can_rename?
@@ -89,11 +85,7 @@ class Projects::IndexPageHeaderComponent < ApplicationComponent
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
+ query.editable?
end
def show_state?