Admin can move project to ANY namespace. Updated permissions page

This commit is contained in:
Dmitriy Zaporozhets 2012-12-04 22:48:24 +02:00
parent 2a1c5cdf99
commit e376f31507
4 changed files with 64 additions and 57 deletions

View file

@ -2,7 +2,9 @@ class ProjectUpdateContext < BaseContext
def execute(role = :default)
namespace_id = params[:project].delete(:namespace_id)
if can?(current_user, :change_namespace, project) && namespace_id.present?
allowed_transfer = can?(current_user, :change_namespace, project) || role == :admin
if allowed_transfer && namespace_id.present?
if namespace_id == Namespace.global_id
if project.namespace.present?
# Transfer to global namespace from anyone