Reject objects with invalid policies instead of fataling
Summary: This is correct, but the root cause of the issue isn't very clear to me. Test Plan: Poked around various pages which filter objects. Reviewers: joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D11727
This commit is contained in:
@@ -411,7 +411,11 @@ final class PhabricatorPolicyFilter {
|
|||||||
$viewer = $this->viewer;
|
$viewer = $this->viewer;
|
||||||
$viewer_phid = $viewer->getPHID();
|
$viewer_phid = $viewer->getPHID();
|
||||||
|
|
||||||
$policy = $this->customPolicies[$viewer_phid][$policy_phid];
|
$policy = idx($this->customPolicies[$viewer_phid], $policy_phid);
|
||||||
|
if (!$policy) {
|
||||||
|
// Reject, this policy is bogus.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$objects = $policy->getRuleObjects();
|
$objects = $policy->getRuleObjects();
|
||||||
$action = null;
|
$action = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user