mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Renamed resource_identifier to resource, refs #817
This commit is contained in:
parent
c9f1ec616e
commit
799c5d5357
12 changed files with 40 additions and 47 deletions
|
|
@ -464,16 +464,11 @@ class Datasette:
|
|||
else:
|
||||
return []
|
||||
|
||||
async def permission_allowed(
|
||||
self, actor, action, resource_identifier=None, default=False
|
||||
):
|
||||
async def permission_allowed(self, actor, action, resource=None, default=False):
|
||||
"Check permissions using the permissions_allowed plugin hook"
|
||||
result = None
|
||||
for check in pm.hook.permission_allowed(
|
||||
datasette=self,
|
||||
actor=actor,
|
||||
action=action,
|
||||
resource_identifier=resource_identifier,
|
||||
datasette=self, actor=actor, action=action, resource=resource,
|
||||
):
|
||||
if callable(check):
|
||||
check = check()
|
||||
|
|
@ -490,7 +485,7 @@ class Datasette:
|
|||
"when": datetime.datetime.utcnow().isoformat(),
|
||||
"actor": actor,
|
||||
"action": action,
|
||||
"resource_identifier": resource_identifier,
|
||||
"resource": resource,
|
||||
"used_default": used_default,
|
||||
"result": result,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue