Open simonw opened 1 month ago
I think the trick here will be to use the django.contrib.auth.get_user
or .aget_user()
methods: https://github.com/django/django/blob/5ed72087c450af1a5da138bdfa674a069cf3f09c/django/contrib/auth/__init__.py#L200
These both take a Django request though, so may need to figure out how to turn ASGI scope into a Django request object - probably using this: https://github.com/django/django/blob/5ed72087c450af1a5da138bdfa674a069cf3f09c/django/core/handlers/asgi.py#L48
Would be good if users could say that only e.g. Django staff members could access
/-/datasette/...