mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
feat: add validation methods for S3 bucket names, paths, and server paths; update import logic to prevent command injection
This commit is contained in:
25
app/Policies/InstanceSettingsPolicy.php
Normal file
25
app/Policies/InstanceSettingsPolicy.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\User;
|
||||
|
||||
class InstanceSettingsPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view the instance settings.
|
||||
*/
|
||||
public function view(User $user, InstanceSettings $settings): bool
|
||||
{
|
||||
return isInstanceAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the instance settings.
|
||||
*/
|
||||
public function update(User $user, InstanceSettings $settings): bool
|
||||
{
|
||||
return isInstanceAdmin();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user