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

class SharingMailer < ApplicationMailer
  include MailNotificationHelper
  helper :mail_notification

  def shared_work_package(sharer, membership, group = nil)
    @sharer = sharer
    @shared_with_user = membership.principal
    @invitation_token = @shared_with_user.invited? ? @shared_with_user.invitation_token : nil
    @group =
    
  def derive_allowed_work_package_actions(role)
    allowed_actions =
      case role.builtin
      when Role::BUILTIN_WORK_PACKAGE_EDITOR
        [I18n.t('work_package.sharing.permissions.view'),
         I18n.t('work_package.sharing.permissions.comment'),
         I18n.t('work_package.sharing.permissions.edit')]
      when Role::BUILTIN_WORK_PACKAGE_COMMENTER
        [I18n.t('work_package.sharing.permissions.view'),
         I18n.t('work_package.sharing.permissions.comment')]
      when Role::BUILTIN_WORK_PACKAGE_VIEWER
        [I18n.t('work_package.sharing.permissions.view')]
      end