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
F15423547: D20919.id49848.diff
Sat, Mar 22, 3:54 PM
F15381073: D20919.id49846.diff
Fri, Mar 14, 5:45 AM
F15336192: D20919.id49846.diff
Sat, Mar 8, 6:25 PM
Unknown Object (File)
Tue, Mar 4, 12:07 AM
Unknown Object (File)
Feb 22 2025, 6:38 AM
Unknown Object (File)
Feb 9 2025, 8:28 AM
Unknown Object (File)
Feb 9 2025, 8:28 AM
Unknown Object (File)
Feb 9 2025, 8:28 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable