diff options
| author | Robert | 2017-07-05 11:54:33 +0200 | 
|---|---|---|
| committer | Robert | 2017-07-05 11:59:06 +0200 | 
| commit | e53aa88c442bd0057c4e0ae66e2684d62d3193ed (patch) | |
| tree | 1ba7c8c082dde92ba215659fde9293e231e7c7df /app/policies/vehicle_journey_policy.rb | |
| parent | 841bd65847066e92bf5a4d6de112fed1ada73c1c (diff) | |
| download | chouette-core-e53aa88c442bd0057c4e0ae66e2684d62d3193ed.tar.bz2 | |
Refs: #3478@1h;
   -  All permissions tied to `!archived?`
   -  Tests adapted
   -  Policies refactored
   ?  Is `create?` permission bound to `organisation_match?`
Diffstat (limited to 'app/policies/vehicle_journey_policy.rb')
| -rw-r--r-- | app/policies/vehicle_journey_policy.rb | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/app/policies/vehicle_journey_policy.rb b/app/policies/vehicle_journey_policy.rb index 7737f6d7e..27d96e43b 100644 --- a/app/policies/vehicle_journey_policy.rb +++ b/app/policies/vehicle_journey_policy.rb @@ -6,14 +6,14 @@ class VehicleJourneyPolicy < ApplicationPolicy    end    def create? -    user.has_permission?('vehicle_journeys.create') # organisation match via referential is checked in the view +    !archived? && organisation_match? && user.has_permission?('vehicle_journeys.create')    end    def destroy? -    organisation_match? && user.has_permission?('vehicle_journeys.destroy') +    !archived? && organisation_match? && user.has_permission?('vehicle_journeys.destroy')    end    def update? -    organisation_match? && user.has_permission?('vehicle_journeys.edit') +    !archived? && organisation_match? && user.has_permission?('vehicle_journeys.edit')    end  end  | 
