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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove final usages of current_user_allowed_to method
Klaus Zanderse7a91fbedbe8
diff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rbindex 744bec8adba..37455afed1f 100644--- a/modules/bim/lib/open_project/bim/engine.rb+++ b/modules/bim/lib/open_project/bim/engine.rb@@ -127,7 +127,7 @@ module OpenProject::Biminclude API::Bim::Utilities::PathHelperlink :bcfTopic,- cache_if: -> { current_user_allowed_to(:view_linked_issues) } do+ cache_if: -> { current_user.allowed_in_project?(:view_linked_issues, represented.project) } donext unless represented.bcf_issue?{@@ -136,7 +136,7 @@ module OpenProject::Bimendlink :convertBCF,- cache_if: -> { current_user_allowed_to(:manage_bcf) } do+ cache_if: -> { current_user.allowed_in_project?(:manage_bcf, represented.project) } donext if represented.bcf_issue? || represented.project.nil?{@@ -148,7 +148,7 @@ module OpenProject::Bimendlinks :bcfViewpoints,- cache_if: -> { current_user_allowed_to(:view_linked_issues) } do+ cache_if: -> { current_user.allowed_in_project?(:view_linked_issues, represented.project) } donext unless represented.bcf_issue?represented.bcf_issue.viewpoints.map do |viewpoint|@@ -178,7 +178,8 @@ module OpenProject::Bimlinks :bcfViewpoints dojournable = represented.journable- next unless current_user_allowed_to(:view_linked_issues) && represented.bcf_comment.present? && journable.bcf_issue?+ next unless current_user.allowed_in_project?(:view_linked_issues, represented.format) &&+ represented.bcf_comment.present? && journable.bcf_issue?# There will only be one viewpoint per comment but we nevertheless return a collection here so that it is more# similar to the work package representer.diff --git a/modules/costs/lib/costs/engine.rb b/modules/costs/lib/costs/engine.rbindex d061bd841d8..ab1094f58b0 100644--- a/modules/costs/lib/costs/engine.rb+++ b/modules/costs/lib/costs/engine.rb@@ -174,8 +174,8 @@ module Costslink :logCosts,cache_if: -> {- current_user_allowed_to(:log_costs, context: represented.project) ||- current_user_allowed_to(:log_own_costs, context: represented.project)+ current_user.allowed_in_project?(:log_costs, context: represented.project) ||+ current_user.allowed_in_project?(:log_own_costs, context: represented.project)} donext unless represented.costs_enabled? && represented.persisted?@@ -188,8 +188,8 @@ module Costslink :showCosts,cache_if: -> {- current_user_allowed_to(:view_cost_entries, context: represented.project) ||- current_user_allowed_to(:view_own_cost_entries, context: represented.project)+ current_user.allowed_in_project?(:view_cost_entries, context: represented.project) ||+ current_user.allowed_in_project?(:view_own_cost_entries, context: represented.project)} donext unless represented.persisted? && represented.project.costs_enabled?