debian-mirror-gitlab/app/policies/custom_emoji_policy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
335 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
class CustomEmojiPolicy < BasePolicy
delegate { @subject.group }
2021-11-11 11:23:49 +05:30
condition(:author) { @subject.creator == @user }
rule { can?(:maintainer_access) }.policy do
enable :delete_custom_emoji
end
rule { author & can?(:create_custom_emoji) }.policy do
enable :delete_custom_emoji
end
2021-01-29 00:20:46 +05:30
end