Sha256: bbcadc62c317032559d2895ab64afe3dae186336ba78038d723a2d7b9f42efcc

Contents?: true

Size: 307 Bytes

Versions: 35

Compression:

Stored size: 307 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module HD
    class ClosedSessionPolicy < BasePolicy
      def destroy?
        edit?
      end

      def edit?
        return false unless record.persisted?

        user_is_admin? || user_is_super_admin? || !record.immutable?
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.1.0 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.167 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.166 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.165 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.164 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.163 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.162 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.161 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.160 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.159 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.158 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.157 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.156 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.155 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.153 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.152 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.151 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.149 app/policies/renalware/hd/closed_session_policy.rb
renalware-core-2.0.148 app/policies/renalware/hd/closed_session_policy.rb