aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/journey_pattern_policy.rb
diff options
context:
space:
mode:
authorRobert2017-04-19 17:41:44 +0200
committerRobert2017-04-19 17:41:44 +0200
commitb767e3c006e9eeee22e2de939605203d8cb99f32 (patch)
tree7a7fec578f4117312d2bc4007f7e9d9af57dcb73 /app/policies/journey_pattern_policy.rb
parentd9fbb75454e7c2b83bb0d7ef06b301f1950cf130 (diff)
parente0fd60242c3994b4157d506c1ce71cab6ffab268 (diff)
downloadchouette-core-b767e3c006e9eeee22e2de939605203d8cb99f32.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'app/policies/journey_pattern_policy.rb')
-rw-r--r--app/policies/journey_pattern_policy.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/policies/journey_pattern_policy.rb b/app/policies/journey_pattern_policy.rb
index 2b5e4c6cd..56f32613c 100644
--- a/app/policies/journey_pattern_policy.rb
+++ b/app/policies/journey_pattern_policy.rb
@@ -11,15 +11,11 @@ class JourneyPatternPolicy < ApplicationPolicy
end
def edit?
- # In React UI, we don't have access to record object yet.
- # In this case record is a symbol
- can_edit = user.has_permission?('journey_patterns.edit')
- record.is_a?(Symbol) ? can_edit : (organisation_match?(via_referential: true) && can_edit)
+ organisation_match? && user.has_permission?('journey_patterns.edit')
end
def destroy?
- can_destroy = user.has_permission?('journey_patterns.destroy')
- record.is_a?(Symbol) ? can_destroy : (organisation_match?(via_referential: true) && can_destroy)
+ organisation_match? && user.has_permission?('journey_patterns.destroy')
end
def update? ; edit? end