summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-28 19:03:01 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-28 19:03:01 +0300
commitaea79b80351109506bd089694df6f22785456f68 (patch)
tree718562db005ea8bca25d8933c7ad4af85b8917f1 /app/models/user.rb
parentaca6be50d3dc1963491c9dcff61dac3b3ec937ca (diff)
downloadgitlab-ce-aea79b80351109506bd089694df6f22785456f68.tar.gz
Add ability rule for creating project in namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 16961e5413b..f1b6139745e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -90,6 +90,8 @@ class User < ActiveRecord::Base
has_many :users_groups, dependent: :destroy
has_many :groups, through: :users_groups
has_many :owned_groups, -> { where users_groups: { group_access: UsersGroup::OWNER } }, through: :users_groups, source: :group
+ has_many :masters_groups, -> { where users_groups: { group_access: UsersGroup::MASTER } }, through: :users_groups, source: :group
+
# Projects
has_many :groups_projects, through: :groups, source: :projects
has_many :personal_projects, through: :namespace, source: :projects