       godmodeCheckbox = @$el.find('#godmode')
       if godmodeCheckbox.length
         permissions.push 'godmode' if godmodeCheckbox.prop('checked')
-      me.set('permissions', permissions)
+      @user.set('permissions', permissions)

    $('#settings-tabs input').removeClass 'changed'
    forms.clearFormAlerts(@$el)
    @grabData()
    res = me.validate()
    if res?
      console.error 'Couldn\'t save because of validation errors:', res
      forms.applyErrorsToForm(@$el, res)
      $('.nano').nanoScroller({scrollTo: @$el.find('.has-error')})
      return

    return unless me.hasLocalChanges()

    res = me.patch()
    return unless res

    res.error =>

    onSaved = (uploadingPath) =>
      @$el.find('#photoURL').val(uploadingPath)
      @$el.find('#photoURL').trigger('change') # cause for some reason editing the value doesn't trigger the jquery event
      @user.set('photoURL', uploadingPath)
      photoContainer.removeClass('saving').attr('src', @user.getPhotoURL(photoContainer.width()))
    filepicker.pick {mimetypes: 'image/*'}, @onImageChosen(onSaving, onSaved)

  formatImagePostData: (inkBlob) ->
