sections: internals:datasette-allowed-resources-sql
This data as json
| id | page | ref | title | content | breadcrumbs | references |
|---|---|---|---|---|---|---|
| internals:datasette-allowed-resources-sql | internals | datasette-allowed-resources-sql | await .allowed_resources_sql(*, action, actor=None, parent=None, include_is_private=False) | Builds the SQL query that Datasette uses to determine which resources an actor may access for a specific action. Returns a (sql: str, params: dict) namedtuple that can be executed against the internal catalog_* database tables. parent can be used to limit results to a specific database, and include_is_private adds a column indicating whether anonymous users would be denied access to that resource. Plugins that need to execute custom analysis over the raw allow/deny rules can use this helper to run the same query that powers the /-/allowed debugging interface. The SQL query built by this method will return the following columns: parent : The parent resource identifier (or NULL) child : The child resource identifier (or NULL) reason : The reason from the rule that granted access is_private : (if include_is_private ) 1 if anonymous users cannot access, 0 otherwise | ["Internals for plugins", "Datasette class"] | [] |