diff options
| author | cedricnjanga | 2018-04-18 07:09:27 -0700 |
|---|---|---|
| committer | cedricnjanga | 2018-04-18 07:13:26 -0700 |
| commit | 982b5b46bdfe313c8385cdf5c899bdc18702c2fe (patch) | |
| tree | 11b0760dc9b772e95ea083362c40066b057f501d | |
| parent | fe3c330cacef3d4367c9a051e3858551986b2c14 (diff) | |
| download | chouette-core-6542-destoy-archived-referential.tar.bz2 | |
Refs #6542 Allow archived referential to be destroyed6542-destoy-archived-referential
| -rw-r--r-- | app/policies/referential_policy.rb | 2 | ||||
| -rw-r--r-- | spec/policies/referential_policy_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/policies/referential_policy.rb b/app/policies/referential_policy.rb index f5c2d7c08..22e5c4dc5 100644 --- a/app/policies/referential_policy.rb +++ b/app/policies/referential_policy.rb @@ -10,7 +10,7 @@ class ReferentialPolicy < ApplicationPolicy end def destroy? - !referential_read_only? && organisation_match? && user.has_permission?('referentials.destroy') + organisation_match? && user.has_permission?('referentials.destroy') end def update? diff --git a/spec/policies/referential_policy_spec.rb b/spec/policies/referential_policy_spec.rb index 778e14901..80369c409 100644 --- a/spec/policies/referential_policy_spec.rb +++ b/spec/policies/referential_policy_spec.rb @@ -33,7 +33,7 @@ RSpec.describe ReferentialPolicy, type: :policy do # --------------------------------------- permissions :destroy? do - it_behaves_like 'permitted policy and same organisation', 'referentials.destroy', archived_and_finalised: true + it_behaves_like 'permitted policy and same organisation', 'referentials.destroy' end permissions :edit? do it_behaves_like 'permitted policy and same organisation', 'referentials.update', archived_and_finalised: true |
