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

Use entity_class instead of hard coded class name in UserPermissibleService

Klaus Zandersd74f81d93032
diff --git a/app/services/authorization/user_permissible_service.rb b/app/services/authorization/user_permissible_service.rb
index d4fa0c535d2..e3ab4fa45ca 100644
--- a/app/services/authorization/user_permissible_service.rb
+++ b/app/services/authorization/user_permissible_service.rb
@@ -51,8 +51,8 @@ module Authorization
context_name(entity_class))
return true if admin_and_all_granted_to_admin?(perms)
- # WorkPackage.allowed_to will also check whether the user has the permission via a membership in the project.
- allowed_scope = WorkPackage.allowed_to(user, perms)
+ # entity_class.allowed_to will also check whether the user has the permission via a membership in the project.
+ allowed_scope = entity_class.allowed_to(user, perms)
if in_project
allowed_scope.exists?(project: in_project)