Sha256: 90375b97345ff0aa8267fade2447a8a48c09c961c6e55807b4277578269905dd

Contents?: true

Size: 525 Bytes

Versions: 27

Compression:

Stored size: 525 Bytes

Contents

require_dependency "renalware/messaging"

module Renalware
  module Modalities
    class DescriptionPolicy < BasePolicy
      # For safety we currently disallow the deletion of any ModalityDescription
      def destroy?
        false
      end

      # Its only possible to edit a ModalityDescription (e.g. to change its name) when it has no
      # (STI) type - ie its not a system-required ModalityDescription.
      def edit?
        record.type.nil?
      end

      def update?
        edit?
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta10 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta9 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta8 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta7 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta6 app/policies/renalware/modalities/description_policy.rb
renalware-core-2.0.0.pre.beta5 app/policies/renalware/modalities/description_policy.rb