parent
16c31e254e
commit
3aa73fba35
|
@ -607,6 +607,15 @@ class ProjectsController < ApplicationController
|
|||
@project.organization_id = params[:organization_id]
|
||||
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
|
||||
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
|
||||
# 更新公开私有时同步gitlab公开私有
|
||||
g = Gitlab.client
|
||||
gproject = g.project(@project.gpid)
|
||||
if params[:project][:is_public]
|
||||
g.edit_project(gproject.id, 20)
|
||||
else
|
||||
g.edit_project(gproject.id, 0)
|
||||
end
|
||||
# end
|
||||
if validate_parent_id && @project.save
|
||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||
if params[:project][:is_public] == '0'
|
||||
|
|
|
@ -72,6 +72,23 @@ class Gitlab::Client
|
|||
post(url, :body => {:name => name}.merge(options))
|
||||
end
|
||||
|
||||
# Updates a project team member to a specified access level.
|
||||
# id (required) - The ID of a project
|
||||
# name (optional) - project name
|
||||
# path (optional) - repository name for project
|
||||
# description (optional) - short project description
|
||||
# default_branch (optional)
|
||||
# issues_enabled (optional)
|
||||
# merge_requests_enabled (optional)
|
||||
# wiki_enabled (optional)
|
||||
# snippets_enabled (optional)
|
||||
# public (optional) - if true same as setting visibility_level = 20
|
||||
# visibility_level (optional)
|
||||
|
||||
def edit_project(id, visibility_level)
|
||||
put("/projects/#{id}", :body => {:visibility_level => visibility_level})
|
||||
end
|
||||
|
||||
# Deletes a project.
|
||||
#
|
||||
# @example
|
||||
|
|
Loading…
Reference in New Issue