mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 22:15:23 +01:00
23 lines
445 B
Ruby
23 lines
445 B
Ruby
# frozen_string_literal: true
|
|
|
|
class TermsOfServicePolicy < ApplicationPolicy
|
|
def index?
|
|
role.can?(:manage_settings)
|
|
end
|
|
|
|
def create?
|
|
role.can?(:manage_settings)
|
|
end
|
|
|
|
def distribute?
|
|
record.published? && !record.notification_sent? && role.can?(:manage_settings)
|
|
end
|
|
|
|
def update?
|
|
!record.published? && role.can?(:manage_settings)
|
|
end
|
|
|
|
def destroy?
|
|
!record.published? && role.can?(:manage_settings)
|
|
end
|
|
end
|