mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
fix(policies): ensure instance-level databases use root team
Instance-level databases like coolify-db (with id = 0) should always be assigned to the root team (id = 0) rather than attempting to resolve their team from the database object itself.
This commit is contained in:
parent
dbbc77830e
commit
cebef8e258
1 changed files with 5 additions and 0 deletions
|
|
@ -109,6 +109,11 @@ class DatabasePolicy
|
|||
|
||||
private function getTeamId($database): ?int
|
||||
{
|
||||
// Instance-level databases (e.g., coolify-db) belong to root team
|
||||
if (isset($database->id) && $database->id === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (method_exists($database, 'team')) {
|
||||
return $database->team()?->id;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue