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

Get rid of explicit usages of `allowed_to_in_project?`

Klaus Zanders3e7e286eafa3
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index e228d150970..3c8cff6b97f 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -258,8 +258,7 @@ class RepositoriesController < ApplicationController
# allow object_src self to be able to load dynamic stats SVGs from ./graph
override_content_security_policy_directives object_src: %w('self')
- @show_commits_per_author = current_user.allowed_to_in_project?(:view_commit_author_statistics,
- @project)
+ @show_commits_per_author = current_user.allowed_in_project?(:view_commit_author_statistics, @project)
end
def graph
@@ -268,7 +267,7 @@ class RepositoriesController < ApplicationController
when 'commits_per_month'
data = graph_commits_per_month(@repository)
when 'commits_per_author'
- unless current_user.allowed_to_in_project?(:view_commit_author_statistics, @project)
+ unless current_user.allowed_in_project?(:view_commit_author_statistics, @project)
return deny_access
end
diff --git a/app/models/users/permission_checks.rb b/app/models/users/permission_checks.rb
index f49917b387e..e138cea59d8 100644
--- a/app/models/users/permission_checks.rb
+++ b/app/models/users/permission_checks.rb
@@ -103,7 +103,7 @@ module Users::PermissionChecks
end
def allowed_to_in_project?(action, project)
- # OpenProject::Deprecation.replaced(:allowed_to_in_project?, :allowed_in_project?, caller)
+ OpenProject::Deprecation.replaced(:allowed_to_in_project?, :allowed_in_project?, caller)
allowed_to?(action, project)
end