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

Remove quickfix in allowed_in_any_entity? query after fixing query

Klaus Zandersa862d7d6e122
diff --git a/app/services/authorization/user_permissible_service.rb b/app/services/authorization/user_permissible_service.rb
index e158da8531d..c0f34958ca4 100644
--- a/app/services/authorization/user_permissible_service.rb
+++ b/app/services/authorization/user_permissible_service.rb
@@ -53,13 +53,12 @@ module Authorization
return true if admin_and_all_granted_to_admin?(perms)
# entity_class.allowed_to will also check whether the user has the permission via a membership in the project.
- # TODO: ^--- thats' actually not the case weirdly...
allowed_scope = entity_class.allowed_to(user, perms)
if in_project
- allowed_in_single_project?(perms, in_project) || allowed_scope.exists?(project: in_project)
+ allowed_scope.exists?(project: in_project)
else
- allowed_in_any_project?(perms) || allowed_scope.exists?
+ allowed_scope.exists?
end
end