Commit e4be9b75 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fj-37254-remove-delete-personal-snippet' into 'master'

Remove destroy_personal_snippet ability

See merge request gitlab-org/gitlab!20717
parents d6c9cf92 d77fa138
......@@ -13,7 +13,6 @@ class PersonalSnippetPolicy < BasePolicy
rule { is_author | admin }.policy do
enable :read_personal_snippet
enable :update_personal_snippet
enable :destroy_personal_snippet
enable :admin_personal_snippet
enable :create_note
end
......
---
title: Remove destroy_personal_snippet ability
merge_request: 20717
author:
type: fixed
......@@ -131,7 +131,7 @@ module API
snippet = snippets_for_current_user.find_by_id(params.delete(:id))
break not_found!('Snippet') unless snippet
authorize! :destroy_personal_snippet, snippet
authorize! :admin_personal_snippet, snippet
destroy_conditionally!(snippet)
end
......
......@@ -11,8 +11,7 @@ describe PersonalSnippetPolicy do
let(:author_permissions) do
[
:update_personal_snippet,
:admin_personal_snippet,
:destroy_personal_snippet
:admin_personal_snippet
]
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment