aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/journey_pattern_policy.rb
blob: beb18d151e9cfe0db5b440e1141e5ee8ae5f306f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class JourneyPatternPolicy < ApplicationPolicy

  class Scope < Scope
    def resolve
      scope
    end
  end

  def create?
    !referential_read_only? && organisation_match? && user.has_permission?('journey_patterns.create')
  end

  def destroy?
    !referential_read_only? && organisation_match? && user.has_permission?('journey_patterns.destroy')
  end

  def update?
    !referential_read_only? && organisation_match? && user.has_permission?('journey_patterns.update')
  end
end