Class: PPIUPolicy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ppiuObject

Returns the value of attribute ppiu

Returns:

  • (Object)

    the current value of ppiu



5
6
7
# File 'app/policies/ppiu_policy.rb', line 5

def ppiu
  @ppiu
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



5
6
7
# File 'app/policies/ppiu_policy.rb', line 5

def user
  @user
end

Instance Method Details

#access?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'app/policies/ppiu_policy.rb', line 15

def access?
  user.loa3? &&
    allowed_providers.include?(user.identity.[:service_name])
end

#access_update?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
# File 'app/policies/ppiu_policy.rb', line 20

def access_update?
  res = EVSS::PPIU::Service.new(user).get_payment_information

  res.responses.first.control_information.authorized?
end

#allowed_providersObject



6
7
8
9
10
11
12
13
# File 'app/policies/ppiu_policy.rb', line 6

def allowed_providers
  %w[
    idme
    oauth_IDME
    logingov
    oauth_LOGINGOV
  ].freeze
end