FIX request devops languages api authoure

This commit is contained in:
Jasder 2020-09-08 15:29:19 +08:00
parent e877c2cde6
commit 3290609bbc
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class ProjectsController < ApplicationController
end
def simple
json_response(@project)
json_response(@project, current_user)
end

View File

@ -28,7 +28,7 @@ module ProjectsHelper
(User.find_by_login identifier) || (User.find_by_mail identifier)
end
def json_response(project)
def json_response(project, user)
repo = project.repository
tmp_json = {}
unless project.common?
@ -45,7 +45,7 @@ module ProjectsHelper
name: project.name,
id: project.id,
repo_id: repo.id,
open_devops: project.open_devops?,
open_devops: (user.blank? || user.is_a?(AnonymousUser)) ? false : project.open_devops?,
type: project.numerical_for_project_type,
author: {
login: project.owner.login,