Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/engine/HeraldEngine.php
| Show First 20 Lines • Show All 456 Lines • ▼ Show 20 Lines | private function canAuthorViewObject( | ||||
| if ($rule->isGlobalRule() || $rule->isObjectRule()) { | if ($rule->isGlobalRule() || $rule->isObjectRule()) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| // The author must be able to create rules for the adapter's content type. | // The author must be able to create rules for the adapter's content type. | ||||
| // In particular, this means that the application must be installed and | // In particular, this means that the application must be installed and | ||||
| // accessible to the user. For example, if a user writes a Differential | // accessible to the user. For example, if a user writes a Differential | ||||
| // rule and then loses access to Differential, this disables the rule. | // rule and then loses access to Differential, this disables the rule. | ||||
| $enabled = HeraldAdapter::getEnabledAdapterMap($rule->getAuthor()); | if (!HeraldAdapter::isAdapterEnabled($rule->getAuthor(), $adapter)) { | ||||
| if (empty($enabled[$adapter->getAdapterContentType()])) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| // Finally, the author must be able to see the object itself. You can't | // Finally, the author must be able to see the object itself. You can't | ||||
| // write a personal rule that CC's you on revisions you wouldn't otherwise | // write a personal rule that CC's you on revisions you wouldn't otherwise | ||||
| // be able to see, for example. | // be able to see, for example. | ||||
| $object = $adapter->getObject(); | $object = $adapter->getObject(); | ||||
| return PhabricatorPolicyFilter::hasCapability( | return PhabricatorPolicyFilter::hasCapability( | ||||
| ▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines | |||||