class Eco::API::UseCases::DefaultCases::ClearAbilitiesTransCase < Eco::API::Common::Loaders::UseCase name "clear-abilities" type :transform def main(people, session, options, usecase) clear_abilities(people.users, session, options, usecase) end private def clear_abilities(users, session, options, usecase) 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