Page MenuHomePhabricator

Proxied object policies are not evaluated in the proper context
Closed, ResolvedPublic

Description

When an object (like a Workboard Column) proxies another object's policies (like the parent project), any object-dependent policies are not evaluated in the correct context.

For example, if you project X with "Visible to: Project Members", workboard columns also have "Project Members" as their policy, but that policy can not be evaluated in the context of workboard columns since columns don't have members.

Three possible approaches are:

  • Make all proxy-able object policies smarter about evaluating in different contexts (e.g., when checking "Project Members" against a workboard column, have it do a check against the containing project).
  • Somehow return the context for the policy from getPolicy().
  • Encode proxy policies as extended policies instead?

These are all varying degrees of complex/messy.

Event Timeline

This was resolved by the introduction of PhabricatorExtendedPolicyInterface. Older cases with missing policy proxies occasionally crop up, but I believe most of them are resolved at HEAD of master. These errors always fail closed (deny access which should be acceptable), never fail open (allow impermissible access) so there's no urgency to hunting them down.

Workboard column policies were likely fixed in D15268.