mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:33:40 +08:00
FEATURE: Allow Forums to disable the Backups feature
This commit is contained in:
@ -2,6 +2,7 @@ require "backup_restore/backup_restore"
|
||||
|
||||
class Admin::BackupsController < Admin::AdminController
|
||||
|
||||
before_action :ensure_backups_enabled
|
||||
skip_before_action :check_xhr, only: [:index, :show, :logs, :check_backup_chunk, :upload_backup_chunk]
|
||||
|
||||
def index
|
||||
@ -178,4 +179,8 @@ class Admin::BackupsController < Admin::AdminController
|
||||
`df -Pk #{Rails.root}/public/backups | awk 'NR==2 {print $4 * 1024;}'`.to_i > size
|
||||
end
|
||||
|
||||
def ensure_backups_enabled
|
||||
raise Discourse::InvalidAccess.new unless SiteSetting.enable_backups?
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user