diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-12 08:58:13 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-12 08:58:13 +0000 |
commit | 87f3a66c32f8cab6c814f81ec9dfea69f64d79cc (patch) | |
tree | 3afd55ea01c39ab1341bf01dbadfe520618a4b6c /app/policies | |
parent | 221a461c1e917e816e30c213d48ad0ff87170527 (diff) | |
parent | fde754e2676e40dcf2600190983ef54030c5d5a5 (diff) | |
download | gitlab-ce-87f3a66c32f8cab6c814f81ec9dfea69f64d79cc.tar.gz |
Merge branch 'features/api-snippets' into 'master'
Adding support for personal snippet endpoint on the API
Closes #22042
See merge request !6373
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/personal_snippet_policy.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/policies/personal_snippet_policy.rb b/app/policies/personal_snippet_policy.rb index 46c5aa1a5be..d3913986cd8 100644 --- a/app/policies/personal_snippet_policy.rb +++ b/app/policies/personal_snippet_policy.rb @@ -6,9 +6,14 @@ class PersonalSnippetPolicy < BasePolicy if @subject.author == @user can! :read_personal_snippet can! :update_personal_snippet + can! :destroy_personal_snippet can! :admin_personal_snippet end + unless @user.external? + can! :create_personal_snippet + end + if @subject.internal? && !@user.external? can! :read_personal_snippet end |