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

QoL improvements for old UserAllowedService

Klaus Zanders1ea4c5f45772
diff --git a/app/services/authorization/user_allowed_service.rb b/app/services/authorization/user_allowed_service.rb
index 9f09458fdf2..7558b061b98 100644
--- a/app/services/authorization/user_allowed_service.rb
+++ b/app/services/authorization/user_allowed_service.rb
@@ -94,6 +94,8 @@ class Authorization::UserAllowedService
end
def allowed_to_in_project?(action, project)
+ return false if project.nil?
+
if project_authorization_cache.cached?(action)
return project_authorization_cache.allowed?(action, project)
end
@@ -171,6 +173,6 @@ class Authorization::UserAllowedService
end
def supported_entity?(entity)
- Member::ALLOWED_ENTITIES.include?(entity.class.to_s)
+ Member.can_be_member_of?(entity)
end
end