mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(sources): restrict system-wide Git sources to instance admins (#12164)
This commit is contained in:
@@ -247,6 +247,10 @@ class GithubController extends Controller
|
||||
], 422);
|
||||
}
|
||||
|
||||
if (! isCloud() && $request->boolean('is_system_wide')) {
|
||||
$this->authorize('makeSystemWide', GithubApp::class);
|
||||
}
|
||||
|
||||
try {
|
||||
// Verify the private key belongs to the team
|
||||
$privateKey = PrivateKey::where('uuid', $request->input('private_key_uuid'))
|
||||
@@ -663,6 +667,10 @@ class GithubController extends Controller
|
||||
$payload['api_url'] = githubApiUrlFromHtmlUrl($payload['html_url']);
|
||||
}
|
||||
|
||||
if (! isCloud() && filter_var($payload['is_system_wide'] ?? false, FILTER_VALIDATE_BOOLEAN) && ! $githubApp->is_system_wide) {
|
||||
$this->authorize('makeSystemWide', GithubApp::class);
|
||||
}
|
||||
|
||||
// Handle private_key_uuid -> private_key_id conversion
|
||||
if (isset($payload['private_key_uuid'])) {
|
||||
$privateKey = PrivateKey::where('team_id', $teamId)
|
||||
|
||||
Reference in New Issue
Block a user