kopia lustrzana https://github.com/simonw/datasette
Clearer docs for actor_matches_allow
rodzic
eefeafaa27
commit
fa87d16612
|
@ -867,7 +867,8 @@ async def async_call_with_supported_arguments(fn, **kwargs):
|
|||
|
||||
|
||||
def actor_matches_allow(actor, allow):
|
||||
actor = actor or {}
|
||||
if actor is None:
|
||||
actor = {"anonymous": True}
|
||||
if allow is None:
|
||||
return True
|
||||
for key, values in allow.items():
|
||||
|
|
|
@ -239,7 +239,7 @@ To limit this ability for just one specific database, use this:
|
|||
actor_matches_allow()
|
||||
=====================
|
||||
|
||||
Plugins that wish to implement the same permissions scheme as canned queries can take advantage of the ``datasette.utils.actor_matches_allow(actor, allow)`` function:
|
||||
Plugins that wish to implement this same ``"allow"`` block permissions scheme can take advantage of the ``datasette.utils.actor_matches_allow(actor, allow)`` function:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue