mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Removed resource_type from permissions system, closes #817
Refs #811, #699
This commit is contained in:
parent
5598c5de01
commit
c9f1ec616e
14 changed files with 39 additions and 89 deletions
|
|
@ -876,24 +876,14 @@ def actor_matches_allow(actor, allow):
|
|||
return False
|
||||
|
||||
|
||||
async def check_visibility(
|
||||
datasette, actor, action, resource_type, resource_identifier, default=True
|
||||
):
|
||||
async def check_visibility(datasette, actor, action, resource_identifier, default=True):
|
||||
"Returns (visible, private) - visible = can you see it, private = can others see it too"
|
||||
visible = await datasette.permission_allowed(
|
||||
actor,
|
||||
action,
|
||||
resource_type=resource_type,
|
||||
resource_identifier=resource_identifier,
|
||||
default=default,
|
||||
actor, action, resource_identifier=resource_identifier, default=default,
|
||||
)
|
||||
if not visible:
|
||||
return (False, False)
|
||||
private = not await datasette.permission_allowed(
|
||||
None,
|
||||
action,
|
||||
resource_type=resource_type,
|
||||
resource_identifier=resource_identifier,
|
||||
default=default,
|
||||
None, action, resource_identifier=resource_identifier, default=default,
|
||||
)
|
||||
return visible, private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue