2020-11-16 16:09:02 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CustomEmojiPolicy < BasePolicy
|
|
|
|
delegate { @subject.group }
|
2021-09-15 08:11:13 -04:00
|
|
|
|
|
|
|
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
|
2020-11-16 16:09:02 -05:00
|
|
|
end
|