mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
feat(access): add scoped grants for team members and API tokens (#12329)
This commit is contained in:
@@ -165,7 +165,9 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $validated;
|
||||
}
|
||||
|
||||
$this->authorize('create', SharedEnvironmentVariable::class);
|
||||
if (in_array($type, ['team', 'server'], true)) {
|
||||
$this->authorize('create', SharedEnvironmentVariable::class);
|
||||
}
|
||||
|
||||
$scope = array_filter([
|
||||
'project_id' => $attributes['project_id'] ?? null,
|
||||
@@ -496,7 +498,7 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $project;
|
||||
}
|
||||
|
||||
$this->authorize('view', $project);
|
||||
$this->authorize('update', $project);
|
||||
|
||||
return $this->createEnv($request, $teamId, 'project', ['project_id' => $project->id]);
|
||||
}
|
||||
@@ -617,7 +619,7 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $environment;
|
||||
}
|
||||
|
||||
$this->authorize('view', $project);
|
||||
$this->authorize('view', $environment);
|
||||
|
||||
return $this->listEnvs($teamId, 'environment', ['environment_id' => $environment->id]);
|
||||
}
|
||||
@@ -658,7 +660,7 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $environment;
|
||||
}
|
||||
|
||||
$this->authorize('view', $project);
|
||||
$this->authorize('update', $environment);
|
||||
|
||||
return $this->createEnv($request, $teamId, 'environment', ['environment_id' => $environment->id]);
|
||||
}
|
||||
@@ -699,7 +701,7 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $environment;
|
||||
}
|
||||
|
||||
$this->authorize('view', $project);
|
||||
$this->authorize('view', $environment);
|
||||
|
||||
return $this->updateEnv(
|
||||
$request,
|
||||
@@ -745,7 +747,7 @@ class SharedEnvironmentVariablesController extends Controller
|
||||
return $environment;
|
||||
}
|
||||
|
||||
$this->authorize('view', $project);
|
||||
$this->authorize('view', $environment);
|
||||
|
||||
return $this->deleteEnv(
|
||||
$teamId,
|
||||
|
||||
Reference in New Issue
Block a user