github
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1175690070 | I_kwDOBm6k_c5GE5tW | 1676 | Reconsider ensure_permissions() logic, can it be less confusing? | 9599 | open | 0 | 3268330 | 3 | 2022-03-21T17:14:57Z | 2022-12-02T01:23:40Z | OWNER | > Updated documentation: https://github.com/simonw/datasette/blob/e627510b760198ccedba9e5af47a771e847785c9/docs/internals.rst#await-ensure_permissionsactor-permissions > >> This method allows multiple permissions to be checked at onced. It raises a `datasette.Forbidden` exception if any of the checks are denied before one of them is explicitly granted. >> >> This is useful when you need to check multiple permissions at once. For example, an actor should be able to view a table if either one of the following checks returns `True` or not a single one of them returns `False`: > > That's pretty hard to understand! I'm going to open a separate issue to reconsider if this is a useful enough abstraction given how confusing it is. _Originally posted by @simonw in https://github.com/simonw/datasette/issues/1675#issuecomment-1074177827_ | 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1676/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
|||||||
1175854982 | I_kwDOBm6k_c5GFh-G | 1679 | Research: how much overhead does the n=1 time limit have? | 9599 | closed | 0 | 3268330 | 11 | 2022-03-21T19:27:46Z | 2022-03-21T21:55:57Z | 2022-03-21T21:55:56Z | OWNER | https://github.com/simonw/datasette/blob/1a7750eb29fd15dd2eea3b9f6e33028ce441b143/datasette/utils/__init__.py#L181-L200 ```python @contextmanager def sqlite_timelimit(conn, ms): deadline = time.perf_counter() + (ms / 1000) # n is the number of SQLite virtual machine instructions that will be # executed between each check. It's hard to know what to pick here. # After some experimentation, I've decided to go with 1000 by default and # 1 for time limits that are less than 50ms n = 1000 if ms < 50: n = 1 def handler(): if time.perf_counter() >= deadline: return 1 conn.set_progress_handler(handler, n) try: yield finally: conn.set_progress_handler(None, n) ``` How often do I set a time limit of 50 or less? How much slower does it go thanks to this code? | 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1679/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | |||||
1175894898 | I_kwDOBm6k_c5GFrty | 1680 | Consider simplifying permissions for 1.0 | 9599 | open | 0 | 3268330 | 0 | 2022-03-21T20:17:29Z | 2022-03-21T20:17:29Z | OWNER | Permission checks right now can express one of three opinions: - `False` means "so not grant this permisson" - `True` means "grant this permission" - `None` means "I have no opinion" But... there's also a concept of a "default" for a given permission check, which might be `False` or `True`. I worry this is too complicated. Could this be simplified before 1.0? In particular the default concept. See also: - #1676 | 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1680/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
|||||||
1175715988 | I_kwDOBm6k_c5GFACU | 1678 | Make `check_visibility()` a documented API | 9599 | closed | 0 | 3268330 | 1 | 2022-03-21T17:30:34Z | 2022-03-21T19:04:03Z | 2022-03-21T19:01:46Z | OWNER | Spotted this while working on: - #1677 https://github.com/simonw/datasette/blob/e627510b760198ccedba9e5af47a771e847785c9/datasette/utils/__init__.py#L1005-L1021 | 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1678/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | |||||
1175694248 | I_kwDOBm6k_c5GE6uo | 1677 | Remove `check_permission()` from `BaseView` | 9599 | closed | 0 | 3268330 | 1 | 2022-03-21T17:18:18Z | 2022-03-21T18:45:04Z | 2022-03-21T18:45:03Z | OWNER | Follow-on from: - #1675 Refs: - #1660 | 107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/1677/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed |