diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 15983217..0ea9db17 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -750,7 +750,7 @@ class ApplicationController < ActionController::Base @project elsif current_user.is_a?(AnonymousUser) logger.info "###########:This is AnonymousUser" - @project = nil if !@project.is_public? + @project = nil if !@project.is_public render_forbidden and return else logger.info "###########:project not found" diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 93c5f694..30fa9660 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -116,7 +116,7 @@ class ProjectsController < ApplicationController end def project_public? - return if @project.is_public? + return if @project.is_public if current_user return if current_user.admin? || @project.member?(current_user.id) diff --git a/app/models/project.rb b/app/models/project.rb index bd2008af..2519700b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -122,7 +122,7 @@ class Project < ApplicationRecord def can_visited? - is_public? || User.current.admin? || member?(User.current) + is_public || User.current.admin? || member?(User.current) end def releases_size(current_user_id, type)