Add terms of service (#33055)
This commit is contained in:
parent
7a2a345c08
commit
30aa0df88c
129 changed files with 1456 additions and 238 deletions
23
app/policies/terms_of_service_policy.rb
Normal file
23
app/policies/terms_of_service_policy.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue