diff options
| author | Luc Donnet | 2017-11-28 12:07:16 +0100 |
|---|---|---|
| committer | Luc Donnet | 2017-11-30 17:08:50 +0100 |
| commit | 17e946771afcff10b6165dd3a97b38aa9c06b1f2 (patch) | |
| tree | 415cc12aefb48e27c00f4837d537edab64d0a393 /app | |
| parent | da082e51238e056709508f180a3797fc008f9848 (diff) | |
| download | chouette-core-17e946771afcff10b6165dd3a97b38aa9c06b1f2.tar.bz2 | |
Fix import policy to not authorize destroy and not be linked with referential state (archived) Refs #5093
Diffstat (limited to 'app')
| -rw-r--r-- | app/policies/compliance_check_set_policy.rb | 14 | ||||
| -rw-r--r-- | app/policies/import_policy.rb | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/app/policies/compliance_check_set_policy.rb b/app/policies/compliance_check_set_policy.rb index 171a33347..85e7e8ddd 100644 --- a/app/policies/compliance_check_set_policy.rb +++ b/app/policies/compliance_check_set_policy.rb @@ -3,5 +3,17 @@ class ComplianceCheckSetPolicy < ApplicationPolicy def resolve scope end + + def create? + false # ComplianceCheckSet can not be created from controller + end + + def destroy? + false # Asynchronous operations must not be deleted + end + + def update? + false # ComplianceCheckSet can not be updated from controller + end end -end
\ No newline at end of file +end diff --git a/app/policies/import_policy.rb b/app/policies/import_policy.rb index b12dcc167..b5e8c5b7e 100644 --- a/app/policies/import_policy.rb +++ b/app/policies/import_policy.rb @@ -6,14 +6,14 @@ class ImportPolicy < ApplicationPolicy end def create? - !archived? && user.has_permission?('imports.create') + user.has_permission?('imports.create') end def destroy? - !archived? && user.has_permission?('imports.destroy') + false # Asynchronous operations must not be deleted end def update? - !archived? && user.has_permission?('imports.update') + user.has_permission?('imports.update') end end |
