Commit a5085e62 authored by Rajendra Kadam's avatar Rajendra Kadam

Update custom emoji policy

parent 8498210c
......@@ -9,7 +9,7 @@ class CustomEmojiPolicy < BasePolicy
enable :delete_custom_emoji
end
rule { author & can?(:developer_access) }.policy do
rule { author & can?(:create_custom_emoji) }.policy do
enable :delete_custom_emoji
end
end
......@@ -89,6 +89,7 @@ class GroupPolicy < BasePolicy
rule { guest }.policy do
enable :read_group
enable :upload_file
enable :guest_access
end
rule { admin }.policy do
......@@ -178,6 +179,7 @@ class GroupPolicy < BasePolicy
enable :update_default_branch_protection
enable :create_deploy_token
enable :destroy_deploy_token
enable :owner_access
end
rule { can?(:read_nested_project_resources) }.policy do
......
......@@ -58,6 +58,16 @@ RSpec.describe CustomEmojiPolicy do
expect_allowed(*custom_emoji_permissions)
end
end
context 'is emoji creator but not a member of the group' do
before do
custom_emoji.update_attribute(:creator, user)
end
it do
expect_disallowed(*custom_emoji_permissions)
end
end
end
end
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