mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 07:13:12 +00:00
New React Backend Repository
DeleteUserWithCascadeAsync never removed UserPermissionOverrides rows, and the FK on UserId is Restrict. Once an override was saved for a member, the admin hard-delete (DeleteUserAsync -> DeleteUserWithCascadeAsync) failed the foreign key inside the transaction and the controller surfaced it as a 400, so the user was never deleted. Add an explicit ExecuteDelete on UserPermissionOverrides before the user is removed, matching how UserRoles is already cleared in the same method (no schema change). SetOverrideAsync was check-then-insert on the composite key with no DbUpdateException handling, so two concurrent PUTs for the same (UserId, PermissionKey) let the loser violate PK_UserPermissionOverrides and return 500. Catch the conflict, detach the pending insert, and converge by updating the persisted row to the caller's requested state. |
||
|---|---|---|
| .ebextensions | ||
| .github | ||
| Api.SeaHavenIndustries | ||
| Api.SeaHavenIndustries.Tests | ||
| Data.SeaHavenIndustries | ||
| docs | ||
| postman | ||
| scripts | ||
| SeaHaven.DataServices | ||
| SeaHaven.Services | ||
| SeaHaven.Services.Tests | ||
| SeaHavenIndustries | ||
| SeaHavenIndustries.Tests | ||
| terraform | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| AGENTS.md | ||
| ARCHITECTURE_AND_CODE_QUALITY.md | ||
| BACKEND_ARCHITECTURE.md | ||
| QUALITY_GATES.md | ||
| REVIEW_AND_PR_FRAMEWORK.md | ||
| SeaHavenIndustries.sln | ||
| TODO.md | ||