{"html_url": "https://github.com/simonw/datasette/issues/1676#issuecomment-1074378472", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1676", "id": 1074378472, "node_id": "IC_kwDOBm6k_c5ACbbo", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-21T20:18:10Z", "updated_at": "2022-03-21T20:18:10Z", "author_association": "OWNER", "body": "Maybe there is a better name for this method that helps emphasize its cascading nature.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1175690070, "label": "Reconsider ensure_permissions() logic, can it be less confusing?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1676#issuecomment-1074180312", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1676", "id": 1074180312, "node_id": "IC_kwDOBm6k_c5ABrDY", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-21T17:16:45Z", "updated_at": "2022-03-21T17:16:45Z", "author_association": "OWNER", "body": "When looking at this code earlier I assumed that the following would check each permission in turn and fail if any of them failed:\r\n```python\r\nawait self.ds.ensure_permissions(\r\n request.actor,\r\n [\r\n (\"view-table\", (database, table)),\r\n (\"view-database\", database),\r\n \"view-instance\",\r\n ]\r\n)\r\n```\r\nBut it's not quite that simple: if any of them fail, it fails... but if an earlier one returns `True` the whole stack passes even if there would have been a failure later on!\r\n\r\nIf that is indeed the right abstraction, I need to work to make the documentation as clear as possible.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1175690070, "label": "Reconsider ensure_permissions() logic, can it be less confusing?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1676#issuecomment-1074178865", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1676", "id": 1074178865, "node_id": "IC_kwDOBm6k_c5ABqsx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-21T17:15:27Z", "updated_at": "2022-03-21T17:15:27Z", "author_association": "OWNER", "body": "This method here: https://github.com/simonw/datasette/blob/e627510b760198ccedba9e5af47a771e847785c9/datasette/app.py#L632-L664", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1175690070, "label": "Reconsider ensure_permissions() logic, can it be less confusing?"}, "performed_via_github_app": null}