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: groups_finder.rb
    path of file: ./repos/gitlabhq/app/finders
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# GroupsFinder
#
# Used to filter Groups by a set of params
#
# Argumen
    
  def authorized_groups
    return unless current_user

    if params.fetch(:include_ancestors, true)
      current_user.authorized_groups.self_and_ancestors
    else
      current_user.authorized_groups
    end