diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-11 14:17:37 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-11 14:17:37 +0300 |
commit | 6eb045fc98f02a54b5db37ff2a43b008fe971158 (patch) | |
tree | 3c961693227b25fb99a1bc065f10e2a71b8b39f3 /app/helpers/namespaces_helper.rb | |
parent | 52f312a8a83eb24fdae41eed7923a64f816f70d3 (diff) | |
download | gitlab-ce-6eb045fc98f02a54b5db37ff2a43b008fe971158.tar.gz |
Prevent Project.all & User.all in selectboxes
Diffstat (limited to 'app/helpers/namespaces_helper.rb')
-rw-r--r-- | app/helpers/namespaces_helper.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index a9a6c78654f..69ad3de5031 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -1,13 +1,7 @@ module NamespacesHelper def namespaces_options(selected = :current_user, scope = :default) - if current_user.admin - groups = Group.all - users = Namespace.root - else - groups = current_user.owned_groups.select {|n| n.type == 'Group'} - users = current_user.namespaces.reject {|n| n.type == 'Group'} - end - + groups = current_user.owned_groups.select {|n| n.type == 'Group'} + users = current_user.namespaces.reject {|n| n.type == 'Group'} global_opts = ["Global", [['/', Namespace.global_id]] ] group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ] |