-
- Downloads
Let non-admins see tables in recents (#48769) (#48812)
* Let non-admins see tables in recents
```shell
❯ http get "localhost:3000/api/activity/recents?context=views" Cookie:"metabase.SESSION=ba..3d" -pb
{
"recents": [
{
"can_write": false,
"database": {
"id": 6,
"initial_sync_status": "complete",
"name": "pg restaurants"
},
"description": null,
"display_name": "Restaurants",
"id": 112,
"model": "table",
"name": "restaurants",
"table_schema": "public",
"timestamp": "2024-10-15T22:11:39.412100Z"
},
{
"can_write": false,
"database": {
"id": 6,
"initial_sync_status": "complete",
"name": "pg restaurants"
},
"description": null,
"display_name": "Reviews",
"id": 110,
"model": "table",
"name": "reviews",
"table_schema": "public",
"timestamp": "2024-10-15T19:53:19.999445Z"
}
]
}
```
We were getting permissions of a "fake" table. Instead, let the db
select it and get the proper stuff. Worked for admins because
mi/can-read? is presumably always true for tables, and worked in tests
because we mocked mi/can-read?
* bump ci
Co-authored-by:
dpsutton <dan@dpsutton.com>
Please register or sign in to comment