mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 08:15:24 +00:00
fix(user-deletion): handle GitHub app sources across team cleanup
Limit team cleanup to apps owned by the deleted team and nullify cross-team application source references before deleting team-owned sources. Adds feature tests covering user deletion with GitHub app-backed applications, preserving system-wide apps, and nullifying external source links.
This commit is contained in:
1 parent
968508583d
commit
3f564f9b2e
3 files changed
+187
-2
No files matched your search
+4
-2
@@ -76,8 +76,10 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
|
||||
foreach ($keys as $key) {
|
||||
$key->delete();
|
||||
}
|
||||
$sources = $team->sources();
|
||||
foreach ($sources as $source) {
|
||||
// Only delete sources owned by this team, not system-wide ones from other teams
|
||||
$teamSources = GithubApp::where('team_id', $team->id)->get()
|
||||
->merge(GitlabApp::where('team_id', $team->id)->get());
|
||||
foreach ($teamSources as $source) {
|
||||
$source->delete();
|
||||
}
|
||||
$tags = Tag::whereTeamId($team->id)->get();
|
||||
|
||||
Reference in new issue
Block a user