You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cache the results of is_admin_or_superuser_check (openedx#146)
* refactor: cache the results of is_admin_or_superuser_check
is_admin_or_superuser_check is being called once per policy when
checking enforcement, creating a potential performance issue with
numerous calls to the database. This adds a brief cache to offload some
of the burden, but we will need a better fix long term.
* refactor: Add RBAC admin cache constants
* refactor: Use RequestCache for RBAC admin matcher
By using the RequestCache instead of the Django cache we are able to
have a thread-local memory copy of the user's superuser / staff state
that exists only for the length of the request. This will save a large
number of round trips to the cache backend.
* chore: Update version and changelog
---------
Co-authored-by: Tycho Hob <[email protected]>
0 commit comments