本文整理汇总了PHP中PFUser::canSee方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::canSee方法的具体用法?PHP PFUser::canSee怎么用?PHP PFUser::canSee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::canSee方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_to_soap
/**
* User can get information about other users if they are active, retricted or suspended
*
* Suspended is needed to be coherent with the GUI where the suspended users are displayed
* like active users to people (otherwise it breaks Mylyn on trackers due to workflow manager)
*
* @param string $identifier
* @param PFUser $user
* @param PFUser $current_user
* @return array
*/
function user_to_soap($identifier, PFUser $user = null, PFUser $current_user)
{
if ($user !== null && ($user->isActive() || $user->isRestricted() || $user->isSuspended())) {
if ($current_user->canSee($user)) {
return array('identifier' => $identifier, 'username' => $user->getUserName(), 'id' => $user->getId(), 'real_name' => $user->getRealName(), 'email' => $user->getEmail(), 'ldap_id' => $user->getLdapId());
}
}
}