Sha256: 16db5b1930ceb5feccbdb681e8839425eae4e89a4ba80eaa46660476df112419

Contents?: true

Size: 613 Bytes

Versions: 8

Compression:

Stored size: 613 Bytes

Contents

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)
  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

8 entries across 8 versions & 1 rubygems

Version Path
eco-helpers-2.5.10 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.9 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.8 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.7 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.6 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.5 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.4 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.3 lib/eco/api/usecases/default_cases/clear_abilities_case.rb