mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-05 22:14:19 +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:
1 parent
dbbc77830e
commit
cebef8e258
1 file changed
+5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user