[ADD]simple去除访问限制,并加入字段

This commit is contained in:
viletyy 2020-12-28 18:41:28 +08:00
parent 43b4907565
commit 27ec7ec7dd
2 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,9 @@ module ProjectsHelper
repo_id: repo.id,
open_devops: (user.blank? || user.is_a?(AnonymousUser)) ? false : project.open_devops?,
type: project.numerical_for_project_type,
author: render_owner(project)
author: render_owner(project),
is_secret: project.is_secret,
user_apply_signatures: project.apply_signatures.with_user_id(user.id).collect{|s| {id: s.id, status: s.status}}
}).compact
render json: tmp_json

View File

@ -7,6 +7,7 @@ module ProjectAbility
def can_read_project?(project)
return true if self.admin?
return true if project.is_secret
return false if !project.is_public? && !project.member?(self.id)
true
end