mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 00:16:42 +00:00
refactor(auth): enforce authorization checks across livewire components
Add authorization checks to multiple Livewire components to ensure users have proper permissions before performing sensitive operations. This includes: - Adding AuthorizesRequests trait to components handling deployments, backups, services, and configuration uploads - Enforcing 'deploy', 'update', and 'manageBackups' authorization checks - Adding instance admin check for system upgrade operations - Improving database queries with team ownership scope - Moving backup trigger from component to button with new backupNow() method
This commit is contained in:
1 parent
cebef8e258
commit
68f81df0bb
10 files changed
+105
-30
No files matched your search
@@ -52,6 +52,7 @@ class DeploymentNavbar extends Component
|
||||
public function force_start()
|
||||
{
|
||||
try {
|
||||
$this->authorize('deploy', $this->application);
|
||||
force_start_deployment($this->application_deployment_queue);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
@@ -82,6 +83,11 @@ class DeploymentNavbar extends Component
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
try {
|
||||
$this->authorize('deploy', $this->application);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
$deployment_uuid = $this->application_deployment_queue->deployment_uuid;
|
||||
$kill_command = "docker rm -f {$deployment_uuid}";
|
||||
$build_server_id = $this->application_deployment_queue->build_server_id ?? $this->application->destination->server_id;
|
||||
|
||||
Reference in new issue
Block a user