mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
BaseView.check_permissions is now datasette.ensure_permissions, closes #1675
Refs #1660
This commit is contained in:
parent
4a4164b811
commit
e627510b76
5 changed files with 71 additions and 36 deletions
|
|
@ -360,8 +360,8 @@ class TableView(RowTableShared):
|
|||
raise NotFound(f"Table not found: {table}")
|
||||
|
||||
# Ensure user has permission to view this table
|
||||
await self.check_permissions(
|
||||
request,
|
||||
await self.ds.ensure_permissions(
|
||||
request.actor,
|
||||
[
|
||||
("view-table", (database, table)),
|
||||
("view-database", database),
|
||||
|
|
@ -950,8 +950,8 @@ class RowView(RowTableShared):
|
|||
except KeyError:
|
||||
raise NotFound("Database not found: {}".format(database_route))
|
||||
database = db.name
|
||||
await self.check_permissions(
|
||||
request,
|
||||
await self.ds.ensure_permissions(
|
||||
request.actor,
|
||||
[
|
||||
("view-table", (database, table)),
|
||||
("view-database", database),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue