mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Document that "allow": {} denies all
https://github.com/simonw/datasette/issues/831#issuecomment-642324847
This commit is contained in:
parent
9f236c4c00
commit
198545733b
2 changed files with 26 additions and 4 deletions
|
|
@ -464,16 +464,19 @@ def test_multi_params(data, should_raise):
|
|||
@pytest.mark.parametrize(
|
||||
"actor,allow,expected",
|
||||
[
|
||||
# Default is to allow:
|
||||
(None, None, True),
|
||||
# {} means deny-all:
|
||||
(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),
|
||||
# Match on just one property:
|
||||
(None, {"id": "root"}, False),
|
||||
({"id": "root"}, None, True),
|
||||
({"id": "simon", "staff": True}, {"staff": True}, True),
|
||||
({"id": "simon", "staff": False}, {"staff": True}, False),
|
||||
# Special "*" value for any key:
|
||||
({"id": "root"}, {"id": "*"}, True),
|
||||
({}, {"id": "*"}, False),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue