Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/markup/PhabricatorMentionRemarkupRule.php
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | public function didMarkupText() { | ||||
$context_object = $engine->getConfig('contextObject'); | $context_object = $engine->getConfig('contextObject'); | ||||
foreach ($metadata as $username => $tokens) { | foreach ($metadata as $username => $tokens) { | ||||
$exists = isset($actual_users[$username]); | $exists = isset($actual_users[$username]); | ||||
$user_has_no_permission = false; | $user_has_no_permission = false; | ||||
if ($exists) { | if ($exists) { | ||||
$user = $actual_users[$username]; | $user = $actual_users[$username]; | ||||
Javelin::initBehavior('phabricator-hovercards'); | Javelin::initBehavior('phui-hovercards'); | ||||
// Check if the user has view access to the object she was mentioned in | // Check if the user has view access to the object she was mentioned in | ||||
if ($context_object | if ($context_object | ||||
&& $context_object instanceof PhabricatorPolicyInterface) { | && $context_object instanceof PhabricatorPolicyInterface) { | ||||
if (!PhabricatorPolicyFilter::hasCapability( | if (!PhabricatorPolicyFilter::hasCapability( | ||||
$user, | $user, | ||||
$context_object, | $context_object, | ||||
PhabricatorPolicyCapability::CAN_VIEW)) { | PhabricatorPolicyCapability::CAN_VIEW)) { | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |