diff options
author | Walmyr Filho <wlsf82@gmail.com> | 2019-01-02 12:33:46 +0100 |
---|---|---|
committer | Walmyr Filho <wlsf82@gmail.com> | 2019-01-02 12:33:46 +0100 |
commit | 00e07e418804e7b69e1b32b74834e6aa0aa21c24 (patch) | |
tree | 9ce72e76ece7bfe5c7c5153fda834a9bc1b0b292 /app/models/snippet.rb | |
parent | de008c132f6228793e8a9a8431dce65009075134 (diff) | |
parent | 191f461b88ba80069c2b23229cc0e26253d4fcc7 (diff) | |
download | gitlab-ce-wlsf82-branches-crud-test.tar.gz |
Merge remote-tracking branch 'upstream/master'wlsf82-branches-crud-test
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 11856b55902..f9b23bbbf6c 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -175,6 +175,12 @@ class Snippet < ActiveRecord::Base :visibility_level end + def embeddable? + ability = project_id? ? :read_project_snippet : :read_personal_snippet + + Ability.allowed?(nil, ability, self) + end + def notes_with_associations notes.includes(:author) end |