Changeset View
Changeset View
Standalone View
Standalone View
src/applications/policy/query/PhabricatorPolicyQuery.php
| Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | foreach ($rule_map as $key => $rule) { | ||||
| ->setShortName($rule->getObjectPolicyShortName()) | ->setShortName($rule->getObjectPolicyShortName()) | ||||
| ->makeEphemeral(); | ->makeEphemeral(); | ||||
| } | } | ||||
| return $results; | return $results; | ||||
| } | } | ||||
| public static function getObjectPolicyRules($object) { | public static function getObjectPolicyRules($object) { | ||||
| $rules = id(new PhutilSymbolLoader()) | $rules = id(new PhutilClassMapQuery()) | ||||
| ->setAncestorClass('PhabricatorPolicyRule') | ->setAncestorClass('PhabricatorPolicyRule') | ||||
| ->loadObjects(); | ->execute(); | ||||
| $results = array(); | $results = array(); | ||||
| foreach ($rules as $rule) { | foreach ($rules as $rule) { | ||||
| $key = $rule->getObjectPolicyKey(); | $key = $rule->getObjectPolicyKey(); | ||||
| if (!$key) { | if (!$key) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||