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

Do not change behavior in AccessControl#permission method, but do it locally

Klaus Zanders0c3d440a1252
diff --git a/lib/open_project/access_control.rb b/lib/open_project/access_control.rb
index 5a10df26251..3d9ada3c900 100644
--- a/lib/open_project/access_control.rb
+++ b/lib/open_project/access_control.rb
@@ -70,7 +70,7 @@ module OpenProject
permissions.detect { |p| p.controller_actions.include?(permission_path) }
else
- permissions.detect { |p| p.name == action&.to_sym }
+ permissions.detect { |p| p.name == action }
end
end
diff --git a/spec/models/activities/fetcher_integration_spec.rb b/spec/models/activities/fetcher_integration_spec.rb
index 267ff56eda9..15a8de00544 100644
--- a/spec/models/activities/fetcher_integration_spec.rb
+++ b/spec/models/activities/fetcher_integration_spec.rb
@@ -118,7 +118,7 @@ RSpec.describe Activities::Fetcher, 'integration' do
.role_permissions
# n.b. public permissions are now stored in the database just like others, so to keep the tests like they are
# we need to filter them out here
- .reject { |permission| OpenProject::AccessControl.permission(permission.permission).public? }
+ .reject { |permission| OpenProject::AccessControl.permission(permission.permission.to_sym).public? }
.map(&:destroy)
end