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: permissions_service.rb
    path of file: ./repos/hyrax/app/services/hyrax/collection_types
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
module Hyrax
  module CollectionTypes
    
    
      def self.can_create_any_collection_type?(user: nil, ability: nil)
        return false unless user.present? || ability.present?
        return true if user_admin?(user, ability)
        # both manage and create access can create collections of a type, so no need to include access in the query
        return true if Hyrax::CollectionTypeParticipant.where(agent_type: Hyrax::CollectionTypeParticipant::USER_TYPE,
                                                              agent_id: user_id(user, ability)).any?
        return true if Hyrax::CollectionTypeParticipant.where(agent_type: Hyrax::CollectionTypeParticipant::GROUP_TYPE,
                                                              agent_id: user_groups(user, ability)).any?
        false
      end