Refactor project creation. Added logout link to profile page

This commit is contained in:
GitLab 2013-01-17 17:35:57 +02:00
parent c7c1a97c2f
commit 232d61d598
19 changed files with 126 additions and 116 deletions

View file

@ -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