mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Renamed resource_identifier to resource, refs #817
This commit is contained in:
parent
c9f1ec616e
commit
799c5d5357
12 changed files with 40 additions and 47 deletions
|
|
@ -121,8 +121,8 @@ Renders a `Jinja template <https://jinja.palletsprojects.com/en/2.11.x/>`__ usin
|
|||
|
||||
.. _datasette_permission_allowed:
|
||||
|
||||
await .permission_allowed(actor, action, resource_identifier=None, default=False)
|
||||
---------------------------------------------------------------------------------
|
||||
await .permission_allowed(actor, action, resource=None, default=False)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
``actor`` - dictionary
|
||||
The authenticated actor. This is usually ``request.actor``.
|
||||
|
|
@ -130,13 +130,15 @@ await .permission_allowed(actor, action, resource_identifier=None, default=False
|
|||
``action`` - string
|
||||
The name of the action that is being permission checked.
|
||||
|
||||
``resource_identifier`` - string, optional
|
||||
The resource identifier, e.g. the name of the table.
|
||||
``resource`` - string, optional
|
||||
The resource, e.g. the name of the table. Only some permissions apply to a resource.
|
||||
|
||||
Check if the given actor has permission to perform the given action on the given resource. This uses plugins that implement the :ref:`plugin_permission_allowed` plugin hook to decide if the action is allowed or not.
|
||||
|
||||
If none of the plugins express an opinion, the return value will be the ``default`` argument. This is deny, but you can pass ``default=True`` to default allow instead.
|
||||
|
||||
See :ref:`permissions` for a full list of permissions included in Datasette core.
|
||||
|
||||
.. _datasette_get_database:
|
||||
|
||||
.get_database(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue