Returns a boolean indicating whether the given User is the publisher of the entry.

@param User $user

@return boolean
196570
public function isPublisher(User $user)
    {
        if ($this->publisher) {
            if ($this->publisher->getUser()->getId() === $user->getId()) {
                return true;
            }
        }

        return false;
    }
541110
private function isSecureExpired(User $user)
    {
        // never expired
        if (!$this->expirationPeriod) {
            return false;
        }

        if (!$lastLogin = $user->getLineLastLogin()) {
            return true;
        }

        return (new \DateTime('-'.$this->expirationPeriod)) > $lastLogin;
    }
292076
public function isOwner( $user = NULL )
	{
		$user	= $user ? $user : get_current_user();
		if( !function_exists( 'posix_getpwuid' ) )
			return TRUE;
		$uid	= fileowner( $this->fileName );
		if( !$uid )
			return TRUE;
		$owner	= posix_getpwuid( $uid );
		if( !$owner )
			return TRUE;
		print_m( $owner );
		return $user == $owner['name'];
	}
1135462
public function update(User $user, User $entity)
    {
        if ($entity->id === $user->id) {
            return true;
        }
        return $user->hasPermission('user-update');
    }
930036
protected function getCallbackStatus(User $user): bool
    {
        $allCurrentNotificationFilter = $user->getBunqUser()->getNotificationFilters();

        /** @var NotificationFilter $filter */
        foreach ($allCurrentNotificationFilter as $filter) {
            if (
                self::NOTIFICATION_CATEGORY_MUTATION === $filter->getCategory()
                && self::NOTIFICATION_DELIVERY_METHOD_URL === $filter->getNotificationDeliveryMethod()
                && $filter->getNotificationTarget() === $this->getUrl()
            ) {
                return true;
            }
        }

        return false;
    }
261128
public function getQbLastByUser(User $user)
    {
        $qb = $this->createQueryBuilder('d')
            ->where('d.createdBy = :user1 OR d.updatedBy = :user2')
            ->orderBy('d.updatedAt', 'desc')
            ->setParameters(
                [
                    'user1' => $user,
                    'user2' => $user,
                ]
            );

        return $qb;
    }
655277
protected function getUserName(User $user): string
    {
        $contentInfo = $this->repository->sudo(
            function (Repository $repository) use ($user): ContentInfo {
                return $this->loadService->loadContent($user->id)->contentInfo;
            }
        );

        return $contentInfo->name;
    }
193132
public function getUserMainDomain(User $user) {
    if($this->domainEnabled) {
      $groups = Group::getUserGroup($user);
      if (is_array($groups)) {
        foreach ($groups as $group) {
          if ($domaine = $group->getDomain()) {
            if ($domaine->status()) {
              return $domaine;
            }
          }
        }
      }
    }
    return NULL;
  }
860442
function isTypingSince(\CharlotteDunois\Yasmin\Models\User $user) {
        if(!$this->isTyping($user)) {
            return -1;
        }
        
        return (\time() - $this->typings->get($user->id)['timestamp']);
    }
35692
public function view($user, Event $event)
    {
        if ($event->creator->id == $user->id) {
            return true;
        }

        return User::findOrFail($user->id)->hasPermission('laralum::events.view');
    }
267083
def user_is_sponsor(self, user):
        
        sponsors = self.get_true_sponsors()
        for sponsor in sponsors:
            sp_user = sponsor.user
            if sp_user == user:
                return True

        return False
1028178
public function ___user($user) {
        $user = posix_getpwnam($user);
        if ($user) {
            posix_setuid($user['uid']);
            posix_setgid($user['gid']);
        }
    }
1295250
public function viewOnFrontend(User $user, Content $content)
    {
        if ($content->canBeShown()) {
            return true;
        }
        return ($content->author->id === $user->id);
    }
965420
public function isUnread(User $user)
    {
        if ($this->posts->count() === 0) {
            return false;
        }

        return $this->posts->last()->isUnread($user);
    }
655122
public function userIsParticipant( eZUser $user )
    {
        /** @var eZCollaborationItemParticipantLink $participantLink */
        foreach ( $this->participantList() as $participantLink )
        {
            $participant = $participantLink->participant();

            if ( $participant instanceof eZUser )
            {
                if ( $participant->attribute( 'contentobject_id' ) == $user->attribute( 'contentobject_id' ) )
                {
                    return true;
                }
            }
            // user group
            else if ( $participant instanceof eZContentObject )
            {
                foreach ( $user->groups() as $userGroup )
                {
                    if ( $participant->attribute( 'id' ) == $userGroup->attribute( 'id' ) )
                    {
                        return true;
                    }
                }
            }
        }
        return false;
    }
861599
public function end(Users $user): bool
    {
        $this->find('users_id = ' . $user->getId())->delete();
        SessionKeys::find('users_id = ' . $user->getId())->delete();

        return true;
    }
381309
protected function is_user_setup($user) {
        if (!isset($this->userssetupcache[$user->id])) {
            $this->userssetupcache[$user->id] = !user_not_fully_set_up($user, true);
        }
        return $this->userssetupcache[$user->id];
    }