Commit 8498210c authored by Rajendra Kadam's avatar Rajendra Kadam

Update custom emoji policy with delegate rules

parent 5a95770f
......@@ -3,11 +3,13 @@
class CustomEmojiPolicy < BasePolicy
delegate { @subject.group }
condition(:admin_custom_emoji) do
@subject.group.member?(@user, Gitlab::Access::MAINTAINER) || @subject.creator == @user
condition(:author) { @subject.creator == @user }
rule { can?(:maintainer_access) }.policy do
enable :delete_custom_emoji
end
rule { admin_custom_emoji }.policy do
rule { author & can?(:developer_access) }.policy do
enable :delete_custom_emoji
end
end
......@@ -132,6 +132,7 @@ class GroupPolicy < BasePolicy
enable :create_custom_emoji
enable :create_package
enable :create_package_settings
enable :developer_access
end
rule { reporter }.policy do
......@@ -161,6 +162,7 @@ class GroupPolicy < BasePolicy
enable :read_deploy_token
enable :create_jira_connect_subscription
enable :update_runners_registration_token
enable :maintainer_access
end
rule { owner }.policy do
......
......@@ -1935,14 +1935,14 @@ Input type: `DestroyCustomEmojiInput`
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationdestroycustomemojiclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationdestroycustomemojiid"></a>`id` | [`CustomEmojiID!`](#customemojiid) | The global ID of the custom emoji to destroy. |
| <a id="mutationdestroycustomemojiid"></a>`id` | [`CustomEmojiID!`](#customemojiid) | Global ID of the custom emoji to destroy. |
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="mutationdestroycustomemojiclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
| <a id="mutationdestroycustomemojicustomemoji"></a>`customEmoji` | [`CustomEmoji`](#customemoji) | The deleted custom emoji. |
| <a id="mutationdestroycustomemojicustomemoji"></a>`customEmoji` | [`CustomEmoji`](#customemoji) | Deleted custom emoji. |
| <a id="mutationdestroycustomemojierrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
### `Mutation.destroyEpicBoard`
......
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