mirror of
https://github.com/glitch-soc/mastodon
synced 2025-04-24 15:24:51 +00:00
23 lines
419 B
Ruby
23 lines
419 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AnnouncementPolicy < ApplicationPolicy
|
|
def index?
|
|
role.can?(:manage_announcements)
|
|
end
|
|
|
|
def create?
|
|
role.can?(:manage_announcements)
|
|
end
|
|
|
|
def update?
|
|
role.can?(:manage_announcements)
|
|
end
|
|
|
|
def destroy?
|
|
role.can?(:manage_announcements)
|
|
end
|
|
|
|
def distribute?
|
|
record.published? && !record.notification_sent? && role.can?(:manage_settings)
|
|
end
|
|
end
|