potiuk opened a new pull request, #74836:
URL: https://github.com/apache/airflow/pull/74836

   `GET /api/v2/assets`, `GET /api/v2/assets/{asset_id}` and the UI `GET 
/ui/assets` endpoint return, for each asset, the `scheduled_dags`, 
`producing_tasks` and `consuming_tasks` references. The asset list itself is 
already scoped to the assets the user can read, but these nested references 
were returned unfiltered, so a user who can read an asset but only some of the 
Dags using it would still see the Dag IDs and task IDs of the other Dags.
   
   This change narrows those three nested lists to the Dags the user can read, 
using the same `ReadableDagsFilterDep` already used by the queued-event and 
dependency-graph endpoints. The filtering lives in 
`AssetResponse.from_asset_row`, and the public list and detail endpoints now 
build their responses through that helper instead of duplicating its body. 
Users with read access to all Dags see no difference. The asset alias endpoints 
return no Dag references, and the UI dependency graph already filters by 
readable Dags, so neither needs a change.
   
   Tests: new tests for the public list, public detail and UI list endpoints 
check that a user who can read only `dag_a` sees only `dag_a` references, that 
no references come back when no Dags are readable, and that every reference 
comes back when all Dags are readable. The pinned query counts go up by one for 
the readable-Dags lookup.
   
   ---
   ##### Was generative AI tooling used to co-author this PR?
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Opus 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to