Commit e376f315 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Admin can move project to ANY namespace. Updated permissions page

parent 2a1c5cdf
......@@ -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
......
......@@ -99,7 +99,8 @@ class Ability
def project_admin_rules
project_master_rules + [
:change_namespace,
:rename_project
:rename_project,
:remove_project
]
end
......
......@@ -23,7 +23,7 @@
.clearfix
= f.label :namespace_id
.input
= f.select :namespace_id, namespaces_options(@project.namespace_id), {}, {class: 'chosen'}
= f.select :namespace_id, namespaces_options(@project.namespace_id, :all), {}, {class: 'chosen'}
&nbsp;
%span.cred Be careful. Changing project namespace can have unintended side effects
......
......@@ -4,17 +4,16 @@
&larr; to index
%hr
.row
.ui-box.span2
%h5 Guest
%ul.unstyled
%fieldset
%legend Guest
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
.ui-box.span3
%h5 Reporter
%ul.unstyled
%fieldset
%legend Reporter
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
......@@ -24,9 +23,9 @@
%li Create a code snippets
.ui-box.span3
%h5 Developer
%ul.unstyled
%fieldset
%legend Developer
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
......@@ -40,9 +39,9 @@
%li Add tags
%li Write a wiki
.ui-box.span3
%h5 Master
%ul.unstyled
%fieldset
%legend Master
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
......@@ -62,3 +61,8 @@
%li Edit project
%li Add Deploy Keys to project
%li Configure Project Hooks
%fieldset
%legend Owner
%ul
%li Transfer project to another namespace
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