Sha256: 516432c52e51b2da0b96a288cc6c9ab189741c651e5c61dfb2dd852e391aff7b

Contents?: true

Size: 667 Bytes

Versions: 40

Compression:

Stored size: 667 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, 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

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
eco-helpers-2.5.2 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.5.1 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.9 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.8 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.7 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.6 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.5 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.4 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.3 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.4.2 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.3.3 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.3.2 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.2.5 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.2.4 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.2.3 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.2.2 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.2.1 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.1.12 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.1.11 lib/eco/api/usecases/default_cases/clear_abilities_case.rb
eco-helpers-2.1.10 lib/eco/api/usecases/default_cases/clear_abilities_case.rb