auth: automatische Firmenzuordnung beim Wegfall der E-Mail-Grundlage entfernen statt senken (Block 7.13, U01, E7)
- Login-Sync löscht auto-Pivots ohne aktuellen Treffer; member wäre die Teamrolle mit Schreibrecht auf alle Firmen-PMs, keine Leserolle - hochgestufte manuelle Mitgliedschaften tragen granted_via=auto-upgrade und fallen auf member zurück; manual und owner bleiben unberührt - company-memberships:audit --classify stuft nur manual-Zeilen um - Plan: E2 revidiert, E7 entschieden, 1.5 und 7.13 nachgezogen Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
3ea9688c9a
commit
b8c6af5f10
4 changed files with 92 additions and 26 deletions
|
|
@ -83,7 +83,7 @@ class AuditCompanyMemberships extends Command
|
|||
$before = (string) $this->option('before');
|
||||
$candidates = $this->responsibleRows()
|
||||
->filter(fn (object $row): bool => isset($explained[$row->company_id.':'.$row->user_id]))
|
||||
->where('granted_via', '!=', 'auto')
|
||||
->where('granted_via', 'manual')
|
||||
->filter(fn (object $row): bool => $before === '' || (string) $row->created_at < $before)
|
||||
->values();
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ class AuditCompanyMemberships extends Command
|
|||
->where('company_id', $row->company_id)
|
||||
->where('user_id', $row->user_id)
|
||||
->where('role', 'responsible')
|
||||
->where('granted_via', '!=', 'auto')
|
||||
->where('granted_via', 'manual')
|
||||
->update(['granted_via' => 'auto']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue