home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "OWNER", issue = 1865281760 and user = 9599 sorted by updated_at descending

✖
✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • simonw · 7 ✖

issue 1

  • Cascade for restricted token view-table/view-database/view-instance operations · 7 ✖

author_association 1

  • OWNER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1697725150 https://github.com/simonw/datasette/pull/2154#issuecomment-1697725150 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5lMTre simonw 9599 2023-08-29T15:54:12Z 2023-08-29T15:54:12Z OWNER

In that last commit I also upgraded Permission from a named tuple to a dataclass, and added a implies_can_view=True private (not documented) option to it.

Last step is to refactor the code to use that new property.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1697612168 https://github.com/simonw/datasette/pull/2154#issuecomment-1697612168 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5lL4GI simonw 9599 2023-08-29T14:57:54Z 2023-08-29T14:57:54Z OWNER

The code to refactor is this: https://github.com/simonw/datasette/blob/d64a9896f743f87b673d58859a0ec16685594e79/datasette/default_permissions.py#L181-L280

I'm going to turn that into a more general restrictions_allow_action function.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1696644066 https://github.com/simonw/datasette/pull/2154#issuecomment-1696644066 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5lILvi simonw 9599 2023-08-29T01:37:47Z 2023-08-29T03:00:25Z OWNER

Code for this might be cleaner with a Restrictions() class that takes a "_r" dictionary to the constructor and can then answer questions like .any_resource_has_permission("view-table") - where it can resolve aliases etc as well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1696642671 https://github.com/simonw/datasette/pull/2154#issuecomment-1696642671 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5lILZv simonw 9599 2023-08-29T01:35:37Z 2023-08-29T01:35:37Z OWNER

Reminder that I also need to confirm that insert-row works if you have it at the instance level, the database level or the resource level in _r.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1696618784 https://github.com/simonw/datasette/pull/2154#issuecomment-1696618784 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5lIFkg simonw 9599 2023-08-29T00:58:34Z 2023-08-29T00:58:34Z OWNER

Should this have implies_can_view=True too? Probably: https://github.com/simonw/datasette/blob/d64a9896f743f87b673d58859a0ec16685594e79/datasette/default_permissions.py#L20-L22

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1691845306 https://github.com/simonw/datasette/pull/2154#issuecomment-1691845306 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5k14K6 simonw 9599 2023-08-24T14:57:39Z 2023-08-24T14:57:39Z OWNER

Notes on manual testing so far - it looks like this might be working! - https://github.com/simonw/datasette/issues/2102#issuecomment-1691824713

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  
1691788400 https://github.com/simonw/datasette/pull/2154#issuecomment-1691788400 https://api.github.com/repos/simonw/datasette/issues/2154 IC_kwDOBm6k_c5k1qRw simonw 9599 2023-08-24T14:25:56Z 2023-08-24T14:25:56Z OWNER

Can be tested with: bash pip install https://github.com/simonw/datasette/archive/6d57a8c23043e99b27f7a2afbe58f4d58815fd51.zip

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cascade for restricted token view-table/view-database/view-instance operations 1865281760  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 1163.461ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows