mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 20:55:14 +02:00
Permission checks ran several queries per request, including a full scan of the resources table. The controller already keeps projects, computes and notifications in process memory: apply the same idea to the RBAC tables. Roles, ACEs, group memberships and resource pool memberships are loaded into a process-wide snapshot. Checks run against the snapshot in memory. Repository write methods mark the snapshot dirty and the next read reloads it from the database, so privilege changes apply right away. The database stays the source of truth. The evaluation is a faithful port of the previous SQL version, quirks included (reverse path traversal, deny raising PermissionError, pool checks with the "/pool" prefix, group ACEs in natural order). The two RBAC tests that mutated ORM objects directly now write through the repository, like the rest of the code. The /projects ACE they relied on was created by another test, so they were order dependent: they now create it when missing.