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

shorten project visibility check

ulfertsded413a25afb
diff --git a/lib/api/v3/projects/projects_api.rb b/lib/api/v3/projects/projects_api.rb
index 6193c5d3a57..429e0a8ef66 100644
--- a/lib/api/v3/projects/projects_api.rb
+++ b/lib/api/v3/projects/projects_api.rb
@@ -52,11 +52,7 @@ module API
end
route_param :id do
after_validation do
- @project = Project.find(params[:id])
-
- authorize(:view_project, context: @project) do
- raise API::Errors::NotFound.new
- end
+ @project = Project.visible(current_user).find(params[:id])
end
get &::API::V3::Utilities::Endpoints::Show.new(model: Project).mount