Commit e69e430c authored by Douwe Maan's avatar Douwe Maan

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

parent 45ca39e8
...@@ -8,7 +8,7 @@ class Import::BaseController < ApplicationController ...@@ -8,7 +8,7 @@ class Import::BaseController < ApplicationController
namespace.add_owner(current_user) namespace.add_owner(current_user)
rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid
namespace = Namespace.find_by_path_or_name(@target_namespace) 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 @already_been_taken = true
return false return false
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment