app/services/hyrax/admin_set_create_service.rb
# Creates an admin set, setting the creator and the default access controls.
# @return [TrueClass, FalseClass] true if it was successful
Creates an admin set, setting the creator and the default access controls.
Creates an admin set setting the creator and the default access controls .
def create
      admin_set.creator = [creating_user.user_key] if creating_user
      admin_set.save.tap do |result|
        if result
          ActiveRecord::Base.transaction do
            permission_template = permissions_create_service.create_default(collection: admin_set,
                                                                            creating_user: creating_user)
            workflow = create_workflows_for(permission_template: permission_template)
            create_default_access_for(permission_template: permission_template, workflow: workflow) if default_admin_set?(id: admin_set.id)
          end
        end
      end
    end
def create admin_set . creator = [ creating_user . user_key ] if creating_user admin_set . save . tap do | result | if result ActiveRecord :: Base . transaction do permission_template = permissions_create_service . create_default ( collection : admin_set , creating_user : creating_user ) workflow = create_workflows_for ( permission_template : permission_template ) create_default_access_for ( permission_template : permission_template , workflow : workflow ) if default_admin_set? ( id : admin_set . id ) end end end end
Creates an admin set, setting the creator and the default access controls.
Creates an admin set setting the creator and the default access controls .
true if it was successful
true if it was successful
TrueClass, FalseClass