本文整理汇总了PHP中Tracker::userCanView方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::userCanView方法的具体用法?PHP Tracker::userCanView怎么用?PHP Tracker::userCanView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker
的用法示例。
在下文中一共展示了Tracker::userCanView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUserCanAccessTracker
/**
* Check that tracker can be accessed by user
*
* @param Tracker $tracker
* @param User $user
* @param Codendi_Request $request
*
* @throws Tracker_CannotAccessTrackerException
*/
public function checkUserCanAccessTracker($tracker, $user, Codendi_Request $request)
{
$this->checkServiceEnabled($tracker->getProject(), $request);
if (!$tracker->isActive()) {
throw new Tracker_CannotAccessTrackerException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'tracker_not_exist'));
}
if (!$tracker->userCanView($user)) {
throw new Tracker_CannotAccessTrackerException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'no_view_permission'));
}
}
示例2: checkUserCanViewTracker
/**
* @throws SoapFault if user can't view the tracker
*/
private function checkUserCanViewTracker(Tracker $tracker, PFUser $user)
{
if (!$tracker->userCanView($user)) {
throw new Exception('Permission Denied: You are not granted sufficient permission to perform this operation.', (string) get_tracker_factory_fault);
}
$this->checkUserCanAccessProject($user, $tracker->getProject());
}
示例3: trackerCanBeDisplayed
private function trackerCanBeDisplayed(Tracker $tracker, PFUser $user)
{
return $tracker->userCanView($user) && !$this->getTV3MigrationManager()->isTrackerUnderMigration($tracker);
}