Sha256: a52f4198d5332ba9eebd90c2e4d575d2112d7f97c883be95e208e650c4f10f97

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eco-helpers-2.6.4 lib/eco/api/usecases/default/people/clear_abilities_case.rb
eco-helpers-2.6.3 lib/eco/api/usecases/default/people/clear_abilities_case.rb
eco-helpers-2.6.2 lib/eco/api/usecases/default/people/clear_abilities_case.rb
eco-helpers-2.6.1 lib/eco/api/usecases/default/people/clear_abilities_case.rb
eco-helpers-2.6.0 lib/eco/api/usecases/default/people/clear_abilities_case.rb