Work / Netpardaz Azar
Access checks as one bitmask test
The problem
Each role carried a JSON permission tree of 20 to 30 KB.
The change
Permissions became numeric ids stored as a bitset. More than 200 permissions fit in 32 bytes, and an access check became a route match plus one bitmask test.
One example role as 256 bits. Each lit bit is a permission the role holds.
My part
I owned the frontend access-control analysis and bug fixing with the backend team, and helped drive the switch.
- 200+permissions
- 32 bytesper role, down from 20 to 30 KB
- 1 testafter the route match