Class: Eco::API::UseCases::DefaultCases::RefreshAbilitiesCase

Inherits:
Common::Loaders::UseCase show all
Defined in:
lib/eco/api/usecases/default_cases/refresh_abilities_case.rb

Instance Method Summary collapse

Methods inherited from Common::Loaders::UseCase

#initialize, type, #type

Methods inherited from Common::BaseLoader

<=>, created_at, #initialize, #name, name_only_once!, set_created_at!

Methods included from Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #new_class, #resolve_class, #to_constant

Constructor Details

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

Instance Method Details

#main(people, session, options, usecase) ⇒ Void

Usecase to refresh the user's account abilities as defined in the org config for their usergroups.

Parameters:

  • people (Eco::API::Organization::People)

    target existing People of the current update.

  • session (Eco::API::Session)

    the current session where the usecase kicks in.

  • options (Hash)

    the options that modify the case behaviour or bring some dependencies.

Returns:

  • (Void)


10
11
12
13
14
15
16
17
# File 'lib/eco/api/usecases/default_cases/refresh_abilities_case.rb', line 10

def main(people, session, options, usecase)
  users    = require_users!(people, session.logger)
  update   = session.new_job("main", "update", :update, usecase, :account)
  users.each do |person|
    person..permissions_custom = session.new_preset(person)
    update.add(person)
  end
end