diff options
author | Stan Hu <stanhu@gmail.com> | 2015-05-25 16:51:37 -0400 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-05-28 11:39:12 -0700 |
commit | 67992b9be6fc19ef4cc06de48995d1ee9617049a (patch) | |
tree | ccd191c5d27b5c9597daa4ca2e6ae1fb655ad823 /app | |
parent | 06250eef2e12ed509b88f3770ae6d3fa4614b74d (diff) | |
download | gitlab-ce-67992b9be6fc19ef4cc06de48995d1ee9617049a.tar.gz |
Make namespace API available to all users
Closes https://github.com/gitlabhq/gitlabhq/issues/9328
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 50ca4bc5acc..8058a0dab8e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -655,6 +655,12 @@ class User < ActiveRecord::Base end end + def namespaces + namespace_ids = groups.pluck(:id) + namespace_ids.push(namespace.id) + Namespace.where(id: namespace_ids) + end + def oauth_authorized_tokens Doorkeeper::AccessToken.where(resource_owner_id: self.id, revoked_at: nil) end |