mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Documented datasette.check_visibility() method, closes #1678
This commit is contained in:
parent
194e4f6c3f
commit
1a7750eb29
5 changed files with 52 additions and 34 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import hashlib
|
||||
import json
|
||||
|
||||
from datasette.utils import add_cors_headers, check_visibility, CustomJSONEncoder
|
||||
from datasette.utils import add_cors_headers, CustomJSONEncoder
|
||||
from datasette.utils.asgi import Response
|
||||
from datasette.version import __version__
|
||||
|
||||
|
|
@ -23,8 +23,7 @@ class IndexView(BaseView):
|
|||
await self.ds.ensure_permissions(request.actor, ["view-instance"])
|
||||
databases = []
|
||||
for name, db in self.ds.databases.items():
|
||||
visible, database_private = await check_visibility(
|
||||
self.ds,
|
||||
visible, database_private = await self.ds.check_visibility(
|
||||
request.actor,
|
||||
"view-database",
|
||||
name,
|
||||
|
|
@ -36,8 +35,7 @@ class IndexView(BaseView):
|
|||
|
||||
views = []
|
||||
for view_name in await db.view_names():
|
||||
visible, private = await check_visibility(
|
||||
self.ds,
|
||||
visible, private = await self.ds.check_visibility(
|
||||
request.actor,
|
||||
"view-table",
|
||||
(name, view_name),
|
||||
|
|
@ -55,8 +53,7 @@ class IndexView(BaseView):
|
|||
|
||||
tables = {}
|
||||
for table in table_names:
|
||||
visible, private = await check_visibility(
|
||||
self.ds,
|
||||
visible, private = await self.ds.check_visibility(
|
||||
request.actor,
|
||||
"view-table",
|
||||
(name, table),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue