class Eco::API::UseCases::Default::People::ClearAbilitiesTransCase < Eco::API::Common::Loaders::UseCase name "clear-abilities" type :transform def main(people, _session, _options, _usecase) clear_abilities(people.users) end private def clear_abilities(users) update = session.new_job("main", "clear-abilities", :update, usecase, :account) users.each do |person| person.account.permissions_custom = nil_abilities.dup update.add(person) end end def nil_abilities @nil_abilities ||= Eco::API::Organization::PresetsFactory.all_abilities end end