Refactor read build permission to be explicit

What does this MR do and why?

After working on !198717 (closed), I decided to make changes gradually.

Build permissions were implicitly calculated by delegating to commit status permissions through CommitStatusPolicy. This approach required recalculating commit status permissions every time build permissions were checked, leading to performance overhead.

Changes made:

  • Remove delegation logic of read from CommitStatusPolicy
  • Add explicit build permission rules directly in ProjectPolicy

This is the second step of this refactoring and performance improvement.

First step: Refactor create/update/admin build permissions ... (!198936 - merged)

References

Related to #549069 (closed)

Screenshots or screen recordings

Please see !198717 (closed)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading