Class: Eco::API::Policies::DefaultPolicies::UserAccess

Inherits:
Common::Loaders::Policy show all
Defined in:
lib/eco/api/policies/default_policies/99_user_access_policy.rb

Overview

Default policy:

  1. Removes the account if the email is empty
  2. Adds the defined default_usergroup if user does not have policy groups
  3. Adds the defined default_login_method if update includes empty login methods

Instance Attribute Summary collapse

Attributes included from Language::AuxiliarLogger

#logger

Instance Method Summary collapse

Methods inherited from Common::Loaders::Policy

#initialize

Methods inherited from Common::Loaders::CaseBase

#name, name_only_once!

Methods inherited from Common::Loaders::Base

<=>, created_at, #initialize, set_created_at!

Methods included from Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant

Methods included from Language::AuxiliarLogger

#log

Constructor Details

This class inherits a constructor from Eco::API::Common::Loaders::Policy

Instance Attribute Details

#account_removed_countObject

Returns the value of attribute account_removed_count.



9
10
11
# File 'lib/eco/api/policies/default_policies/99_user_access_policy.rb', line 9

def 
  @account_removed_count
end

#jobObject (readonly)

Returns the value of attribute job.



8
9
10
# File 'lib/eco/api/policies/default_policies/99_user_access_policy.rb', line 8

def job
  @job
end

Instance Method Details

#main(_peo, _sess, _opts, _plc, job) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/eco/api/policies/default_policies/99_user_access_policy.rb', line 11

def main(_peo, _sess, _opts, _plc, job)
  @job = job

  self. = 0

  people.each do |person|
    (person)

    next if options.dig(:skip, :api_policies)
    next unless ( = person.)
    next if options.dig(:exclude, :account)

    add_def_policy_group_if_applicable!()
    ()
  end

  
end