af83/chouette-core

View on GitHub
app/policies/policy/line_notice_membership_collection.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Policy
  class LineNoticeMembershipCollection < Base
    authorize_by Strategy::Permission
    permission_exception :update, 'line_notice_memberships.destroy'

    protected

    def _update?
      line_policy = ::Policy::Line.new(resource.proxy_association.owner, context: context)
      line_policy.update? && line_policy.create?(::Chouette::LineNoticeMembership)
    end
  end
end