issue_comments
8 rows where issue = 1396948693
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
id ▼ | html_url | issue_url | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
1267708232 | https://github.com/simonw/datasette/issues/1829#issuecomment-1267708232 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5Lj7FI | simonw 9599 | 2022-10-04T23:17:36Z | 2022-10-04T23:17:36Z | OWNER | Here's the relevant code from the table page: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/table.py#L215-L227 Note how `ensure_permissions()` there takes the table, database and instance into account... but the `private` assignment (used to decide if the padlock should display or not) only considers the `view-table` check. Here's the same code for the database page: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L139-L141 And for canned query pages: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L228-L240 | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1267709546 | https://github.com/simonw/datasette/issues/1829#issuecomment-1267709546 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5Lj7Zq | simonw 9599 | 2022-10-04T23:19:24Z | 2022-10-04T23:21:07Z | OWNER | There's also a `check_visibility()` helper which I'm not using in these particular cases but which may be relevant. It's called like this: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L65-L77 And is defined here: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/app.py#L694-L710 It's actually documented as a public method here: https://docs.datasette.io/en/stable/internals.html#await-check-visibility-actor-action-resource-none > This convenience method can be used to answer the question "should this item be considered private, in that it is visible to me but it is not visible to anonymous users?" > > It returns a tuple of two booleans, `(visible, private)`. `visible` indicates if the actor can see this resource. `private` will be `True` if an anonymous user would not be able to view the resource. Note that this documented method cannot actually do the right thing - because it's not being given the multiple permissions that need to be checked in order to completely answer the question. So I probably need to redesign that method a bit. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1278237331 | https://github.com/simonw/datasette/issues/1829#issuecomment-1278237331 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5MMFqT | simonw 9599 | 2022-10-13T22:17:45Z | 2022-10-13T22:19:22Z | OWNER | I think `check_visibility` should be changed to optionally accept `permissions=` which is the same list of tuples that can be passed to `ensure_permissions`. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1278300241 | https://github.com/simonw/datasette/issues/1829#issuecomment-1278300241 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5MMVBR | simonw 9599 | 2022-10-14T00:03:52Z | 2022-10-14T00:04:28Z | OWNER | Here's what I've got so far: ```diff diff --git a/datasette/app.py b/datasette/app.py index 5fa4955c..df9eae49 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -1,5 +1,5 @@ import asyncio -from typing import Sequence, Union, Tuple +from typing import Sequence, Union, Tuple, Optional import asgi_csrf import collections import datetime @@ -707,7 +707,7 @@ class Datasette: Raises datasette.Forbidden() if any of the checks fail """ - assert actor is None or isinstance(actor, dict) + assert actor is None or isinstance(actor, dict), "actor must be None or a dict" for permission in permissions: if isinstance(permission, str): action = permission @@ -732,23 +732,34 @@ class Datasette: else: raise Forbidden(action) - async def check_visibility(self, actor, action, resource): + async def check_visibility( + self, + actor: dict, + action: Optional[str] = None, + resource: Optional[str] = None, + permissions: Optional[ + Sequence[Union[Tuple[str, Union[str, Tuple[str, str]]], str]] + ] = None, + ): """Returns (visible, private) - visible = can you see it, private = can others see it too""" - visible = await self.permission_allowed( - actor, - action, - resource=resource, - default=True, - ) - if not visible: + if permissions: + assert ( + not action and not resource + ), "Can't use action= or resource= with permissions=" + else: + permissions = [(action, resource)] + try: + await self.ensure_permissions(actor, permissions) + except Forbidden: return False, False - private = not await self.permission_allowed( - None, - action, - resource=resource, - default=True, -… | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1278302478 | https://github.com/simonw/datasette/issues/1829#issuecomment-1278302478 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5MMVkO | simonw 9599 | 2022-10-14T00:06:19Z | 2022-10-14T00:06:19Z | OWNER | I'll finish this in a PR: - https://github.com/simonw/datasette/pull/1842 | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1288308945 | https://github.com/simonw/datasette/issues/1829#issuecomment-1288308945 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5MygjR | simonw 9599 | 2022-10-24T02:07:50Z | 2022-10-24T02:07:50Z | OWNER | Useful test: if you sign in as root to https://latest.datasette.io/_internal/columns/_internal,columns,database_name you can see there's no padlock icon on that page or on https://latest.datasette.io/_internal/columns - fixing this bug should fix that. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1288320411 | https://github.com/simonw/datasette/issues/1829#issuecomment-1288320411 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5MyjWb | simonw 9599 | 2022-10-24T02:21:19Z | 2022-10-24T02:21:19Z | OWNER | Updated docs for `check_visibility()`: https://docs.datasette.io/en/latest/internals.html#await-check-visibility-actor-action-none-resource-none-permissions-none | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 | |
1288321630 | https://github.com/simonw/datasette/issues/1829#issuecomment-1288321630 | https://api.github.com/repos/simonw/datasette/issues/1829 | IC_kwDOBm6k_c5Myjpe | simonw 9599 | 2022-10-24T02:22:49Z | 2022-10-24T02:23:46Z | OWNER | Visit https://latest.datasette.io/login-as-root and then: https://latest.datasette.io/ <img width="719" alt="image" src="https://user-images.githubusercontent.com/9599/197436195-5594f1fd-4509-46c5-bd2b-dd7f5f83c004.png"> https://latest.datasette.io/_internal/columns <img width="813" alt="image" src="https://user-images.githubusercontent.com/9599/197436239-df57fa3a-216c-4de6-b77c-255824ce63b6.png"> https://latest.datasette.io/_internal/columns/_internal,columns,cid <img width="735" alt="image" src="https://user-images.githubusercontent.com/9599/197436264-e1cc5570-86b6-4a4b-8cc1-9df0f67a8275.png"> https://latest.datasette.io/_internal/from_hook <img width="443" alt="image" src="https://user-images.githubusercontent.com/9599/197436372-17380539-ce0c-48ab-bb78-a058ad14ba5a.png"> That's all as it should be. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | Table/database that is private due to inherited permissions does not show padlock 1396948693 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);