Page MenuHomePhabricator

When predicting object policies for project milestones, adjust objects so they behave like milestones
ClosedPublic

Authored by epriestley on Nov 19 2019, 6:29 AM.
Tags
None
Referenced Files
F18900325: D20919.id49846.diff
Nov 7 2025, 8:43 PM
F18877326: D20919.id49848.diff
Nov 6 2025, 7:29 AM
F18875919: D20919.id.diff
Nov 5 2025, 8:15 PM
F18868988: D20919.diff
Nov 4 2025, 9:30 AM
F18853537: D20919.id.diff
Oct 31 2025, 5:37 PM
F18852613: D20919.id.diff
Oct 31 2025, 10:44 AM
F18739389: D20919.id.diff
Oct 1 2025, 9:15 PM
F18728673: D20919.diff
Sep 30 2025, 9:42 AM
Subscribers
None

Details

Summary

Ref T13462. Currently, when testing milestone edit policies during creation, the project object does not behave like a milestone:

  • it doesn't have a milestone number yet, so it doesn't try to access the parent project; and
  • the parent project isn't attached yet.

Instead: attach the parent project sooner (which "should" be harmless, although it's possible this has weird side effects); and give the adjusted policy object a dummy milestone number if it doesn't have one yet. This forces it to act like a milestone when emitting policies.

Test Plan
  • Set "Projects" application default edit policy to "No One".
  • Created a milestone I had permission to create.
    • Before: failed with a policy error, because the project behaved like a non-milestone and returned "No One" as the effective edit policy.
    • After: worked properly, correctly evaluting the parent project edit policy as the effective edit policy.
  • Tried to create a milestone I did not have permission to create (no edit permission on parent project).
    • Got an appropriate edit policy error.

Diff Detail

Repository
rP Phabricator
Branch
ppolicy1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23674
Build 32551: Run Core Tests
Build 32550: arc lint + arc unit