fix(vikon): exclude non-writable dirs from access check (vendor, build, vikon_core)

This commit is contained in:
F4ilji
2026-07-04 18:34:19 +05:00
parent 11b145861d
commit 4cc3505050
@@ -57,9 +57,18 @@ class CheckAccessAction
private function findNonWritable(string $path, int $depth = 0): array
{
if ($depth > 3 || !is_dir($path)) return [];
if (!is_writable($path)) {
return [str_replace(base_path() . '/', '', $path)];
$relative = str_replace(base_path() . '/', '', $path);
$excluded = ['vendor', 'node_modules', 'storage', '.git', 'bootstrap/cache'];
foreach ($excluded as $ex) {
if (str_starts_with($relative, $ex)) return [];
}
if (!is_writable($path)) {
return [$relative];
}
$result = [];
foreach (File::directories($path) as $dir) {
$result = array_merge($result, $this->findNonWritable($dir, $depth + 1));