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
F13168674: D20919.diff
Tue, May 7, 7:53 AM
Unknown Object (File)
Sun, May 5, 6:18 AM
Unknown Object (File)
Fri, May 3, 7:33 AM
Unknown Object (File)
Thu, May 2, 10:16 AM
Unknown Object (File)
Sun, Apr 28, 6:48 AM
Unknown Object (File)
Thu, Apr 25, 7:55 AM
Unknown Object (File)
Thu, Apr 25, 1:36 AM
Unknown Object (File)
Mon, Apr 22, 11:03 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