diff --git a/app/policies/copyright_policy.rb b/app/policies/copyright_policy.rb index cd7d64e33bc798de9f1dba5edd69fa7fb69fece1..9edc38748125bb1ade57b6649bcfa8d16a5914d4 100644 --- a/app/policies/copyright_policy.rb +++ b/app/policies/copyright_policy.rb @@ -10,15 +10,15 @@ class CopyrightPolicy < ApplicationPolicy end def create? - false + user? && user.admin? end def update? - false + user? && user.admin? end def destroy? - false + user? && user.admin? end class Scope < ApplicationPolicy::Scope diff --git a/app/policies/image_size_policy.rb b/app/policies/image_size_policy.rb index 0106e32fb8e6fbee1ae95cdefa8d1d25e0e1ee61..939903191b26035d15b4465f364d5a15b2d7d0fb 100644 --- a/app/policies/image_size_policy.rb +++ b/app/policies/image_size_policy.rb @@ -10,15 +10,15 @@ class ImageSizePolicy < ApplicationPolicy end def create? - false + user? && user.admin? end def update? - false + user? && user.admin? end def destroy? - false + user? && user.admin? end class Scope < ApplicationPolicy::Scope diff --git a/app/policies/literature_policy.rb b/app/policies/literature_policy.rb index dbc0f58a6674eec2948970eb8be6e0241a9e3415..ced8f7db0fdff1e37b33d0148156a8e70c6f15a4 100644 --- a/app/policies/literature_policy.rb +++ b/app/policies/literature_policy.rb @@ -10,15 +10,15 @@ class LiteraturePolicy < ApplicationPolicy end def create? - false + user? && user.admin? end def update? - false + user? && user.admin? end def destroy? - false + user? && user.admin? end class Scope < ApplicationPolicy::Scope diff --git a/app/policies/text_policy.rb b/app/policies/text_policy.rb index e037528ae3ea760f843ead23d87c4b07b35b2942..ddddc26c9389ce66c1e8122f41f551a11ee1879f 100644 --- a/app/policies/text_policy.rb +++ b/app/policies/text_policy.rb @@ -10,15 +10,15 @@ class TextPolicy < ApplicationPolicy end def create? - false + user? && user.admin? end def update? - false + user? && user.admin? end def destroy? - false + user? && user.admin? end class Scope < ApplicationPolicy::Scope diff --git a/spec/policies/copyright_policy_spec.rb b/spec/policies/copyright_policy_spec.rb index 11639a85d6679e3f4763ede3e2b27ed7bf498ac7..d6cd66f4843203c346cda17db979781b5d24f738 100644 --- a/spec/policies/copyright_policy_spec.rb +++ b/spec/policies/copyright_policy_spec.rb @@ -39,9 +39,9 @@ RSpec.describe CopyrightPolicy do it { is_expected.to permit_action(:index) } it { is_expected.to permit_action(:show) } - it { is_expected.to forbid_new_and_create_actions } - it { is_expected.to forbid_edit_and_update_actions } - it { is_expected.to forbid_action(:destroy) } + it { is_expected.to permit_new_and_create_actions } + it { is_expected.to permit_edit_and_update_actions } + it { is_expected.to permit_action(:destroy) } end describe "Scope" do diff --git a/spec/policies/image_size_policy_spec.rb b/spec/policies/image_size_policy_spec.rb index 58cd7eebbab5ef766714eb79fd0b3f6021a2b53b..24c3b7c45c83646fa801766c5086a7ac3a6d35bf 100644 --- a/spec/policies/image_size_policy_spec.rb +++ b/spec/policies/image_size_policy_spec.rb @@ -39,9 +39,9 @@ RSpec.describe ImageSizePolicy do it { is_expected.to permit_action(:index) } it { is_expected.to permit_action(:show) } - it { is_expected.to forbid_new_and_create_actions } - it { is_expected.to forbid_edit_and_update_actions } - it { is_expected.to forbid_action(:destroy) } + it { is_expected.to permit_new_and_create_actions } + it { is_expected.to permit_edit_and_update_actions } + it { is_expected.to permit_action(:destroy) } end describe "Scope" do diff --git a/spec/policies/literature_policy_spec.rb b/spec/policies/literature_policy_spec.rb index 4739c49fa4ac8ce6f452c49d47530bf1eb54d60c..ea5b878c05f8206e33848c143e92d1df7bc55532 100644 --- a/spec/policies/literature_policy_spec.rb +++ b/spec/policies/literature_policy_spec.rb @@ -39,9 +39,9 @@ RSpec.describe LiteraturePolicy do it { is_expected.to permit_action(:index) } it { is_expected.to permit_action(:show) } - it { is_expected.to forbid_new_and_create_actions } - it { is_expected.to forbid_edit_and_update_actions } - it { is_expected.to forbid_action(:destroy) } + it { is_expected.to permit_new_and_create_actions } + it { is_expected.to permit_edit_and_update_actions } + it { is_expected.to permit_action(:destroy) } end describe "Scope" do diff --git a/spec/policies/text_policy_spec.rb b/spec/policies/text_policy_spec.rb index 3907b756bacf08afbd9c696ab18567e509ea7cc3..a992ca6c235e0fa778a2bc2e32b26bdeb1247314 100644 --- a/spec/policies/text_policy_spec.rb +++ b/spec/policies/text_policy_spec.rb @@ -39,9 +39,9 @@ RSpec.describe TextPolicy do it { is_expected.to permit_action(:index) } it { is_expected.to permit_action(:show) } - it { is_expected.to forbid_new_and_create_actions } - it { is_expected.to forbid_edit_and_update_actions } - it { is_expected.to forbid_action(:destroy) } + it { is_expected.to permit_new_and_create_actions } + it { is_expected.to permit_edit_and_update_actions } + it { is_expected.to permit_action(:destroy) } end describe "Scope" do