1
0
mirror of https://github.com/mastodon/mastodon synced 2025-01-10 20:03:22 +09:00
mastodon/app/policies/terms_of_service_policy.rb

24 lines
445 B
Ruby
Raw Normal View History

2024-12-09 19:04:46 +09:00
# 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