Class: LegacyMHVMessagingPolicy

Inherits:
Struct
  • Object
show all
Defined in:
app/policies/legacy_mhv_messaging_policy.rb

Overview

TODO: migrate all services off this policy and onto the new one.

Constant Summary collapse

SM_ACCOUNT_TYPES =
%w[Premium].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#legacy_mhv_messagingObject

Returns the value of attribute legacy_mhv_messaging

Returns:

  • (Object)

    the current value of legacy_mhv_messaging



4
5
6
# File 'app/policies/legacy_mhv_messaging_policy.rb', line 4

def legacy_mhv_messaging
  @legacy_mhv_messaging
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



4
5
6
# File 'app/policies/legacy_mhv_messaging_policy.rb', line 4

def user
  @user
end

Instance Method Details

#access?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/policies/legacy_mhv_messaging_policy.rb', line 6

def access?
  SM_ACCOUNT_TYPES.include?(user.) && user.va_patient?
end