summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorGitLab <gitlab@localhost>2013-01-17 17:35:57 +0200
committerGitLab <gitlab@localhost>2013-01-17 17:35:57 +0200
commit232d61d59808e6f0c731d135d728800c4b13ae27 (patch)
tree87356bbbd97abd549fcc489fb3bed60dc0438528 /app/models/user.rb
parentc7c1a97c2fecb8931bbe66af6860a072ca97335d (diff)
downloadgitlab-ce-232d61d59808e6f0c731d135d728800c4b13ae27.tar.gz
Refactor project creation. Added logout link to profile page
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 7e69f3db84c..7a75379e500 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -152,11 +152,8 @@ class User < ActiveRecord::Base
namespaces << self.namespace if self.namespace
# Add groups you can manage
- namespaces += if admin
- Group.all
- else
- groups.all
- end
+ namespaces += groups.all
+
namespaces
end
@@ -234,6 +231,10 @@ class User < ActiveRecord::Base
end
end
+ def can_select_namespace?
+ several_namespaces? || admin
+ end
+
def can? action, subject
abilities.allowed?(self, action, subject)
end