             role is 'user' or
             (ENV.current_user_roles and role in ENV.current_user_roles)
         locals =
-          showEmail: ENV.current_user_id
+          showEmail: @showEmail()
           helpLinks: links
           url: window.location
           contextAssetString: ENV.context_asset_string

    initTicketForm: ->
      $form = @$dialog.find('#create_ticket').formSubmit
        disableWhileLoading: true
        required: ->
          requiredFields = ['error[subject]', 'error[comments]', 'error[user_perceived_severity]']
          requiredFields.push 'error[email]' if ENV.current_user_id
          requiredFields
        success: =>
          @$dialog.dialog('close')

  helpDialog =
    defaultTitle: I18n.t 'Help', "Help"

    showEmail: -> not ENV.current_user_id

    initDialog: ->
      @$dialog = $('<div style="padding:0; overflow: visible;" />').dialog
        resizable: false
