Allow projects to be imported into namespaces user is master of.

This commit is contained in:
Douwe Maan 2015-04-06 14:50:43 +02:00
parent 45ca39e81b
commit e69e430ce7
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class Import::BaseController < ApplicationController
namespace.add_owner(current_user)
rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid
namespace = Namespace.find_by_path_or_name(@target_namespace)
unless namespace.owner == current_user
unless current_user.can?(:create_projects, namespace)
@already_been_taken = true
return false
end