view-database permission

Also now using 🔒 to indicate private resources - resources that
would not be available to the anonymous user. Refs #811
This commit is contained in:
Simon Willison 2020-06-07 20:50:37 -07:00
commit 9b42e1a4f5
8 changed files with 69 additions and 16 deletions

View file

@ -58,8 +58,7 @@ class DatabaseView(DataView):
tables.sort(key=lambda t: (t["hidden"], t["name"]))
canned_queries = [
dict(
query,
requires_auth=not actor_matches_allow(None, query.get("allow", None)),
query, private=not actor_matches_allow(None, query.get("allow", None)),
)
for query in self.ds.get_canned_queries(database)
if actor_matches_allow(