Class: Eco::API::Policies::DefaultPolicies::UserAccess
- Inherits:
-
Common::Loaders::Policy
- Object
- Common::Loaders::Base
- Common::Loaders::CaseBase
- Common::Loaders::Policy
- Eco::API::Policies::DefaultPolicies::UserAccess
- Defined in:
- lib/eco/api/policies/default_policies/99_user_access_policy.rb
Overview
Default policy:
- Removes the account if the email is empty
- Adds the defined default_usergroup if user does not have policy groups
- Adds the defined default_login_method if update includes empty login methods
Instance Attribute Summary collapse
-
#account_removed_count ⇒ Object
Returns the value of attribute account_removed_count.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
Methods inherited from Common::Loaders::Policy
Methods inherited from Common::Loaders::CaseBase
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
Constructor Details
This class inherits a constructor from Eco::API::Common::Loaders::Policy
Instance Attribute Details
#account_removed_count ⇒ Object
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 @account_removed_count end |
#job ⇒ Object (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.account_removed_count = 0 people.each do |person| remove_account_when_no_email!(person) next if .dig(:skip, :api_policies) next unless (account = person.account) next if .dig(:exclude, :account) add_def_policy_group_if_applicable!(account) add_login_method_if_applicable!(account) end warn_account_removal! end |