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: user_context.rb
    path of file: ./repos/hitobito/app/abilities/ability_dsl
    
    the code of the file until where you have to start completion: # encoding: utf-8

#  Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
#  hitobito and licensed under the Affero General Public License version 3
#  or later. 
    
    def init_permission_groups
      @permission_group_ids = GROUP_PERMISSIONS.each_with_object({}) do |permission, hash|
        groups = user.groups_with_permission(permission).to_a
        given = Role::PermissionImplications.invert[permission]
        groups += user.groups_with_permission(given).to_a if given
        hash[permission] = groups
      end
    end