summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2019-01-24 12:44:46 +0000
committerNick Thomas <nick@gitlab.com>2019-01-24 12:44:46 +0000
commit40900669b3bde03468d709c479794a758b431d8c (patch)
tree807a6567e50b691796b84cff62515dd25172ea52 /spec/policies
parent16ab0050f6f1544eb717da34975f12861df37c9c (diff)
downloadgitlab-ce-40900669b3bde03468d709c479794a758b431d8c.tar.gz
Allow admins/auditors to read private personal snippets
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/personal_snippet_policy_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/policies/personal_snippet_policy_spec.rb b/spec/policies/personal_snippet_policy_spec.rb
index 3809692b373..397eaee068c 100644
--- a/spec/policies/personal_snippet_policy_spec.rb
+++ b/spec/policies/personal_snippet_policy_spec.rb
@@ -128,6 +128,17 @@ describe PersonalSnippetPolicy do
end
end
+ context 'admin user' do
+ subject { permissions(admin_user) }
+
+ it do
+ is_expected.to be_allowed(:read_personal_snippet)
+ is_expected.to be_disallowed(:comment_personal_snippet)
+ is_expected.to be_disallowed(:award_emoji)
+ is_expected.to be_disallowed(*author_permissions)
+ end
+ end
+
context 'external user' do
subject { permissions(external_user) }