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

Correctl use allowed_in_any_entity

Klaus Zanders93d6f2a7d7d5
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 5e06b5186a0..f8c0d6f37a8 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -278,11 +278,11 @@ class ApplicationController < ActionController::Base
allowed
end
- def authorize_in_any_entity(ctrl = params[:controller], action = params[:action])
+ def authorize_in_any_model(ctrl = params[:controller], action = params[:action])
allowed = if @project
- User.current.allowed_in_any_entity?({ controller: ctrl, action: }, in_project: @project)
+ User.current.allowed_in_any_entity?({ controller: ctrl, action: }, model_object, in_project: @project)
else
- User.current.allowed_in_any_entity?({ controller: ctrl, action: })
+ User.current.allowed_in_any_entity?({ controller: ctrl, action: }, model_object)
end
deny_access unless allowed