mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
unauthenticated: true method plus allow block docs, closes #825
This commit is contained in:
parent
70dd14876e
commit
7633b9ab24
6 changed files with 134 additions and 55 deletions
|
|
@ -464,12 +464,16 @@ def test_multi_params(data, should_raise):
|
|||
@pytest.mark.parametrize(
|
||||
"actor,allow,expected",
|
||||
[
|
||||
({"id": "root"}, None, True),
|
||||
({"id": "root"}, {}, False),
|
||||
({"anonymous": True}, {"anonymous": True}, True),
|
||||
(None, None, True),
|
||||
(None, {}, False),
|
||||
(None, {"id": "root"}, False),
|
||||
({"id": "root"}, None, True),
|
||||
({"id": "root"}, {}, False),
|
||||
({"id": "simon", "staff": True}, {"staff": True}, True),
|
||||
({"id": "simon", "staff": False}, {"staff": True}, False),
|
||||
# Special case for "unauthenticated": true
|
||||
(None, {"unauthenticated": True}, True),
|
||||
(None, {"unauthenticated": False}, False),
|
||||
# Special "*" value for any key:
|
||||
({"id": "root"}, {"id": "*"}, True),
|
||||
({}, {"id": "*"}, False),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue