Skip to content

Commit

Permalink
ds_actor cookie documentation, closes #826
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 9, 2020
1 parent 008e2f6 commit b5f04f4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,31 @@ The currently authenticated actor is made available to plugins as ``request.acto

.. _PermissionsDebugView:

Permissions Debug
=================
The permissions debug tool
==========================

The debug tool at ``/-/permissions`` is only available to the :ref:`authenticated root user <authentication_root>` (or any actor granted the ``permissions-debug`` action according to a plugin).

It shows the thirty most recent permission checks that have been carried out by the Datasette instance.

This is designed to help administrators and plugin authors understand exactly how permission checks are being carried out, in order to effectively configure Datasette's permission system.

.. _authentication_ds_actor:

The ds_actor cookie
===================

Datasette includes a default authentication plugin which looks for a signed ``ds_actor`` cookie containing a JSON actor dictionary. This is how the :ref:`root actor <authentication_root>` mechanism works.

Authentication plugins can set signed ``ds_actor`` cookies themselves like so:

.. code-block:: python
response = Response.redirect("/")
response.set_cookie("ds_actor", datasette.sign({"id": "cleopaws"}, "actor"))
return response
Note that you need to pass ``"actor"`` as the namespace to :ref:`datasette_sign`.

.. _permissions:

Expand Down

0 comments on commit b5f04f4

Please # to comment.