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

Reflect on EntityClass, not Entity

Klaus Zanders008a959cd98f
diff --git a/app/services/authorization/user_permissible_service.rb b/app/services/authorization/user_permissible_service.rb
index dc5a7e073b7..e0dddb4d819 100644
--- a/app/services/authorization/user_permissible_service.rb
+++ b/app/services/authorization/user_permissible_service.rb
@@ -43,7 +43,7 @@ module Authorization
entities = Array(entities_to_check)
entities.all? do |entity|
- allowed_in_single_entity?(perms, entity)
+ allowed_in_single_entity?(perms, entity, entity_class)
end
end
@@ -96,8 +96,8 @@ module Authorization
cached_permissions(project).intersect?(permissions_filtered_for_project)
end
- def allowed_in_single_entity?(permissions, entity)
- if entity_is_project_scoped?(entity.class)
+ def allowed_in_single_entity?(permissions, entity, entity_class)
+ if entity_is_project_scoped?(entity_class)
allowed_in_single_project_scoped_entity?(permissions, entity)
else
allowed_in_single_standalone_entity?(permissions, entity)