diff --git a/app/contexts/project_update_context.rb b/app/contexts/project_update_context.rb index 90ced7600ed..5b77d0a7964 100644 --- a/app/contexts/project_update_context.rb +++ b/app/contexts/project_update_context.rb @@ -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 diff --git a/app/models/ability.rb b/app/models/ability.rb index cffb6e4277b..2d80c6720b7 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -99,7 +99,8 @@ class Ability def project_admin_rules project_master_rules + [ :change_namespace, - :rename_project + :rename_project, + :remove_project ] end diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index d306cfd84a7..d90d4a03d67 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -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'}   %span.cred Be careful. Changing project namespace can have unintended side effects diff --git a/app/views/help/permissions.html.haml b/app/views/help/permissions.html.haml index f9287fa0996..cf8ce9c5560 100644 --- a/app/views/help/permissions.html.haml +++ b/app/views/help/permissions.html.haml @@ -4,61 +4,65 @@ ← to index %hr -.row - .ui-box.span2 - %h5 Guest - %ul.unstyled - %li Create new issue - %li Leave comments - %li Write on project wall +%fieldset + %legend Guest + %ul + %li Create new issue + %li Leave comments + %li Write on project wall - .ui-box.span3 - %h5 Reporter - %ul.unstyled - %li Create new issue - %li Leave comments - %li Write on project wall - %li Pull project code - %li Download project - %li Create new merge request - %li Create a code snippets +%fieldset + %legend Reporter + %ul + %li Create new issue + %li Leave comments + %li Write on project wall + %li Pull project code + %li Download project + %li Create new merge request + %li Create a code snippets - .ui-box.span3 - %h5 Developer - %ul.unstyled - %li Create new issue - %li Leave comments - %li Write on project wall - %li Pull project code - %li Download project - %li Create new merge request - %li Create a code snippets - %li Create new branches - %li Push to non-protected branches - %li Remove non-protected branches - %li Add tags - %li Write a wiki +%fieldset + %legend Developer + %ul + %li Create new issue + %li Leave comments + %li Write on project wall + %li Pull project code + %li Download project + %li Create new merge request + %li Create a code snippets + %li Create new branches + %li Push to non-protected branches + %li Remove non-protected branches + %li Add tags + %li Write a wiki - .ui-box.span3 - %h5 Master - %ul.unstyled - %li Create new issue - %li Leave comments - %li Write on project wall - %li Pull project code - %li Download project - %li Create new merge request - %li Create a code snippets - %li Create new branches - %li Push to non-protected branches - %li Remove non-protected branches - %li Add tags - %li Write a wiki - %li Add new team members - %li Push to protected branches - %li Remove protected branches - %li Push with force option - %li Edit project - %li Add Deploy Keys to project - %li Configure Project Hooks +%fieldset + %legend Master + %ul + %li Create new issue + %li Leave comments + %li Write on project wall + %li Pull project code + %li Download project + %li Create new merge request + %li Create a code snippets + %li Create new branches + %li Push to non-protected branches + %li Remove non-protected branches + %li Add tags + %li Write a wiki + %li Add new team members + %li Push to protected branches + %li Remove protected branches + %li Push with force option + %li Edit project + %li Add Deploy Keys to project + %li Configure Project Hooks + +%fieldset + %legend Owner + %ul + %li Transfer project to another namespace