summaryrefslogtreecommitdiff
path: root/app/helpers/namespaces_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 14:17:37 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-11 14:17:37 +0300
commit6eb045fc98f02a54b5db37ff2a43b008fe971158 (patch)
tree3c961693227b25fb99a1bc065f10e2a71b8b39f3 /app/helpers/namespaces_helper.rb
parent52f312a8a83eb24fdae41eed7923a64f816f70d3 (diff)
downloadgitlab-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.rb10
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]} ]