Refactor project creation. Added logout link to profile page
This commit is contained in:
parent
c7c1a97c2f
commit
232d61d598
19 changed files with 126 additions and 116 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue