You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: admin_sets_lw.rb
    path of file: ./repos/hyrax/spec/factories
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
FactoryBot.define do
  # Tests that create a Fedora Object are very slow.  This factory lets you control which parts of the object ecosystem
  # get built.
  #
  # PREFERRED: Use build whenever possible.  You can control the creation of the permission template and solr document
  #            by passing parameters to the build(:admin_set_lw) method.  That way you can build only the parts needed
  #            for a specific test.
  #
  # AVOID: Do not use create unless absolutely necessary.  It will create everything i
    
    def self.solr_document_with_permissions(adminset, evaluator, creator_only)
      adminset.id ||= FactoryBot.generate(:object_id)
      if creator_only
        adminset.edit_users = [evaluator.user]
      else
        adminset.edit_users = user_managers(evaluator.with_permission_template, evaluator.user)
        adminset.edit_groups = group_managers(evaluator.with_permission_template)
        adminset.read_users = user_viewers(evaluator.with_permission_template) +
                              user_depositors(evaluator.with_permission_template)
        adminset.read_groups = group_viewers(evaluator.with_permission_template) +
                               group_depositors(evaluator.with_permission_template) -
                               [::Ability.registered_group_name, ::Ability.public_group_name]
      end