diff options
author | Toon Claes <toon@gitlab.com> | 2017-06-22 09:35:49 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-06-23 12:15:35 +0300 |
commit | b90f1098cf42889c32eb6f12779def005f15cbae (patch) | |
tree | b36866422e1948909f5be1f26a91a84a2c3b6fbc /lib/gitlab/visibility_level.rb | |
parent | f09aa6b755043e9bba1eb7ae8f1ae45adc5df136 (diff) |
Add User#full_private_access? to check if user has Private access
In CE only the admin has access to all private groups & projects. In EE also an
auditor can have full private access.
To overcome merge conflicts, or accidental incorrect access rights, abstract
this out in `User#full_private_access?`.
`User#admin?` now only should be used for admin-only features. For private
access-related features `User#full_private_access?` should be used.
Backported from gitlab-org/gitlab-ee!2199
Diffstat (limited to 'lib/gitlab/visibility_level.rb')
-rw-r--r-- | lib/gitlab/visibility_level.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index 36e5b5041a6..48f3d950779 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -28,7 +28,7 @@ module Gitlab def levels_for_user(user = nil) return [PUBLIC] unless user - if user.admin? + if user.full_private_access? [PRIVATE, INTERNAL, PUBLIC] elsif user.external? [PUBLIC] |