本文整理匯總了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);
}