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

Extend the `Boards::AddButtonComponent` to be usable in global and project contexts

Aaron Contrerase298ca25e09a
diff --git a/modules/boards/app/components/boards/add_button_component.rb b/modules/boards/app/components/boards/add_button_component.rb
index 3bed8eb1912..d1c122852c2 100644
--- a/modules/boards/app/components/boards/add_button_component.rb
+++ b/modules/boards/app/components/boards/add_button_component.rb
@@ -32,7 +32,11 @@
module Boards
class AddButtonComponent < ::AddButtonComponent
def render?
- User.current.allowed_to_globally?(:manage_board_views)
+ if current_project
+ User.current.allowed_to?(:manage_board_views, current_project)
+ else
+ User.current.allowed_to_globally?(:manage_board_views)
+ end
end
def dynamic_path