mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 04:14:59 +00:00
feat(auth): implement authorization checks for database management
This commit is contained in:
1 parent
6d02f6a60b
commit
adb8f9d88e
17 files changed
+281
-27
No files matched your search
@@ -3,14 +3,19 @@
|
||||
namespace App\Livewire\Project\Database;
|
||||
|
||||
use App\Jobs\DatabaseBackupJob;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Livewire\Component;
|
||||
|
||||
class BackupNow extends Component
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
|
||||
public $backup;
|
||||
|
||||
public function backupNow()
|
||||
{
|
||||
$this->authorize('manageBackups', $this->backup->database);
|
||||
|
||||
DatabaseBackupJob::dispatch($this->backup);
|
||||
$this->dispatch('success', 'Backup queued. It will be available in a few minutes.');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user