Sha256: fd296d86104c3f4c4097ec4d831e83991d47cc3a489dd5461d9f807250d19aca
Contents?: true
Size: 1.11 KB
Versions: 29
Compression:
Stored size: 1.11 KB
Contents
class Eco::API::UseCases::DefaultCases::RefreshAbilitiesCase < Eco::API::Common::Loaders::UseCase name "refresh-abilities" type :transform # Usecase to refresh the user's account abilities as defined in the org config for their usergroups. # @param people [Eco::API::Organization::People] target existing _People_ of the current update. # @param session [Eco::API::Session] the current session where the usecase kicks in. # @param options [Hash] the options that modify the case behaviour or bring some dependencies. # @return [Void] 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.account.permissions_custom = session.new_preset(person) update.add(person) end end private def require_users!(people, logger) people.users.tap do |users| unless users.length > 0 logger.warn("There are no people with account amoung your #{people.length} people") exit(1) end end end end
Version data entries
29 entries across 29 versions & 1 rubygems