fix: commit the bulk ACE deletion in the repository

delete_all_ace_starting_with_path was the only RBAC write method
without a commit. The request session is only closed at teardown, so
the deletion was rolled back and the ACEs came back on the next
snapshot reload. Tests did not catch it because they share one
session for the whole class.
This commit is contained in:
YueGuobin committed 2026-11-06 23:55:12 +08:00
1 parent 2244d730bb
commit f87f20cb27
2 files changed
+22

No files matched your search

+1
View File
@@ -295,6 +295,7 @@ class RbacRepository(BaseRepository):
query = delete(models.ACE).where(models.ACE.path.startswith(path)).execution_options(synchronize_session=False)
result = await self._db_session.execute(query)
await self._db_session.commit()
self._rbac_state.mark_dirty()
log.debug(f"{cast(CursorResult, result).rowcount} ACE(s) have been deleted")