diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-05-01 16:14:35 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-05-02 16:22:24 +0300 |
commit | 43ff7386411af0f538710f3627622f71e5e34472 (patch) | |
tree | 3bb4d32c1389504d70395f36e8e223899fcbccd5 /app/policies | |
parent | 6277bda61c511696f9d12fae4238b5214a722571 (diff) |
Support uploaders for personal snippets comments
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/personal_snippet_policy.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/personal_snippet_policy.rb b/app/policies/personal_snippet_policy.rb index d3913986cd8..e1e5336da8c 100644 --- a/app/policies/personal_snippet_policy.rb +++ b/app/policies/personal_snippet_policy.rb @@ -3,11 +3,16 @@ class PersonalSnippetPolicy < BasePolicy can! :read_personal_snippet if @subject.public? return unless @user + if @subject.public? + can! :comment_personal_snippet + end + if @subject.author == @user can! :read_personal_snippet can! :update_personal_snippet can! :destroy_personal_snippet can! :admin_personal_snippet + can! :comment_personal_snippet end unless @user.external? @@ -16,6 +21,7 @@ class PersonalSnippetPolicy < BasePolicy if @subject.internal? && !@user.external? can! :read_personal_snippet + can! :comment_personal_snippet end end end |