mirror of
https://github.com/mastodon/mastodon.git
synced 2025-03-13 18:58:14 +01: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
|