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

Filter out duplicates if the same actions are allowed by different permissions

Klaus Zandersaacaf82fd180
diff --git a/spec/models/capabilities/scopes/default_spec.rb b/spec/models/capabilities/scopes/default_spec.rb
index 56069c6f25d..ec90ea360ac 100644
--- a/spec/models/capabilities/scopes/default_spec.rb
+++ b/spec/models/capabilities/scopes/default_spec.rb
@@ -333,6 +333,7 @@ RSpec.describe Capabilities::Scopes::Default do
.map { |_, v| v[:actions].map { |vk, vv| vv.map { |vvv| item.call(vk, vvv, v[:global], v[:module_name]) } } }
.flatten(2)
.compact
+ .uniq { |v| v.join(",") }
end
it 'does not include actions of permissions non-grantable to admin' do
@@ -368,6 +369,7 @@ RSpec.describe Capabilities::Scopes::Default do
.map { |_, v| v[:actions].map { |vk, vv| vv.map { |vvv| item.call(vk, vvv, v[:global], v[:module_name]) } } }
.flatten(2)
.compact
+ .uniq { |v| v.join(",") }
end
end
end