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
User tenancy data is used by Centurion for user authorization. Currently the authorization system fetches this multiple times from the database.
Details
Django currently adds the user details to the request via middleware, django.contrib.auth.middleware.AuthenticationMiddleware, This class will have to be overridden to add the tenancy details.
Django 5.1 Class
classAuthenticationMiddleware(MiddlewareMixin):
defprocess_request(self, request):
ifnothasattr(request, "session"):
raiseImproperlyConfigured(
"The Django authentication middleware requires session ""middleware to be installed. Edit your MIDDLEWARE setting to ""insert ""'django.contrib.sessions.middleware.SessionMiddleware' before ""'django.contrib.auth.middleware.AuthenticationMiddleware'."
)
request.user=SimpleLazyObject(lambda: get_user(request))
request.auser=partial(auser, request)
modification of the above class, specifically AuthenticationMiddleware.process_request().request.user, to ensure the following is included:
Groups
Teams
Organizations
The above models will also require pre-fetching of the following:
User tenancy data is used by Centurion for user authorization. Currently the authorization system fetches this multiple times from the database.
Details
Django currently adds the user details to the request via middleware,
django.contrib.auth.middleware.AuthenticationMiddleware
, This class will have to be overridden to add the tenancy details.Django 5.1 Class
modification of the above class, specifically
AuthenticationMiddleware.process_request().request.user
, to ensure the following is included:The above models will also require pre-fetching of the following:
content_types
permissions
Links
Tasks
The text was updated successfully, but these errors were encountered: