summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2017-05-10 18:57:19 +0000
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-05-10 18:57:19 +0000
commit9c7d87ef0ec941b389cb5ef57a07ff0f43909305 (patch)
tree827aaf4dbb628eb31517aaf2960814a521430229 /app/models/snippet.rb
parent1e0df21a74017deb780023ed83f04dbbeed13899 (diff)
parent180ec7113e358a7f8388e1436dc0670a11ba68df (diff)
downloadgitlab-ce-docs/hide-gcp-install.tar.gz
Merge branch 'master' into 'docs/hide-gcp-install'docs/hide-gcp-install
# Conflicts: # doc/install/README.md
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb13
1 files changed, 0 insertions, 13 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index abfbefdf9a0..882e2fa0594 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -152,18 +152,5 @@ class Snippet < ActiveRecord::Base
where(table[:content].matches(pattern))
end
-
- def accessible_to(user)
- return are_public unless user.present?
- return all if user.admin?
-
- where(
- 'visibility_level IN (:visibility_levels)
- OR author_id = :author_id
- OR project_id IN (:project_ids)',
- visibility_levels: [Snippet::PUBLIC, Snippet::INTERNAL],
- author_id: user.id,
- project_ids: user.authorized_projects.select(:id))
- end
end
end