Returns the owner of this entity

@return PKEncryptionEnabledUserInterface
437767
public function getOwnerUser()
    {
        $reflection = ClassUtils::newReflectionObject($this);

        if ($reflection->hasMethod('getUser')) {
            return $this->getUser();
        }
        elseif ($reflection->hasMethod('getUserProfile')) {
            return $this->getUserProfile() ? $this->getUserProfile()->getUser() : null;
        }

        return null;
    }
1287648
public function getRequestUser()
    {
        if ($this->requestUser === null) {
            $token = $this->getRequestApiToken();
            if ($token === '') {
                $this->requestUser = 'no-token';
            } else {
                $ip = $this->app->make('ip');
                if ($ip->isBanned()) {
                    $this->requestUser = 'banned';
                } else {
                    $requestUser = null;
                    $list = new UserList();
                    $list->disableAutomaticSorting();
                    $list->filterByAttribute('api_token', $token);
                    $ids = $list->getResultIDs();
                    if (!empty($ids)) {
                        $u = \User::getByUserID($ids[0]);
                        if ($u->isRegistered()) {
                            $requestUser = $u;
                        }
                    }
                    if ($requestUser === null) {
                        $this->requestUser == 'invalid-token';
                        $ip->logSignupRequest();
                        if ($ip->signupRequestThreshholdReached()) {
                            $ip->createIPBan();
                        }
                    } else {
                        $this->requestUser = $requestUser;
                    }
                }
            }
        }
        if ($this->requestUser === 'no-token') {
            throw AccessDeniedException::create(t('API Access Token required'));
        }
        if ($this->requestUser === 'banned') {
            throw AccessDeniedException::create($this->app->make('ip')->getErrorMessage());
        }
        if ($this->requestUser === 'invalid-token') {
            throw AccessDeniedException::create(t('Bad API Access Token'));
        }

        return $this->requestUser;
    }
1046736
protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }

        if (!$this->tokenStorage->getToken()) {
            return;
        }

        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof UserInterface) {
            return $user;
        }

        return;
    }
712414
protected function getCurrentUser()
    {
        if ($this->tokenStorage && ($token = $this->tokenStorage->getToken())) {
            $user = $token->getUser();

            if ($user instanceof UserInterface) {
                return $user;
            }
        }

        return;
    }
319144
public function getUser()
    {
        if (null !== $this->user) {
            return $this->user;
        }
        if (null === $this->userCallable) {
            return;
        }

        $callable = $this->userCallable;

        return $callable();
    }
207776
public function getUser()
    {
        if (null === $token = $this->securityContext->getToken()) {
            return;
        }

        if (!is_object($user = $token->getUser())) {
            return;
        }

        return $user;
    }
563740
public function getPermissionAccessObject()
    {
        if ($this->permissionObjectToCheck instanceof Area) {
            $app = Application::getFacadeApplication();
            $db = $app->make(Connection::class);
            $r = $db->fetchColumn(
                'select paID from AreaPermissionAssignments where cID = ? and arHandle = ? and pkID = ? ',
                [
                    $this->permissionObjectToCheck->getCollectionID(),
                    $this->permissionObjectToCheck->getAreaHandle(),
                    $this->pk->getPermissionKeyID(),
                ]
            );
            if ($r) {
                return Access::getByID($r, $this->pk, false);
            }
        } elseif (isset($this->inheritedPermissions[$this->pk->getPermissionKeyHandle()])) {
            // this is a page
            $pk = PermissionKey::getByHandle($this->inheritedPermissions[$this->pk->getPermissionKeyHandle()]);
            $pk->setPermissionObject($this->permissionObjectToCheck);
            $pae = $pk->getPermissionAccessObject();

            return $pae;
        } elseif (isset($this->blockTypeInheritedPermissions[$this->pk->getPermissionKeyHandle()])) {
            $pk = PermissionKey::getByHandle($this->blockTypeInheritedPermissions[$this->pk->getPermissionKeyHandle()]);
            $pae = $pk->getPermissionAccessObject();

            return $pae;
        }

        return null;
    }
478321
public function user()
    {
        if (!is_null($this->user)) {
            return $this->user;
        }
        $user = null;
        try {
            $resourceId = Authorizer::getResourceOwnerId();
            $resourceType = Authorizer::getResourceOwnerType();
        } catch (\Exception $e) {
            $resourceId = null;
            $resourceType = null;
            // throw $e;
        }
        if ($resourceType !== $this->id) {
            return null;
        }
        if (!empty($resourceId)) {
            $user = $this->getProvider()->retrieveById($resourceId);
        }
        return $this->user = $user;

    }
1160309
public function getOwner(): string
    {
        if ($this->caching == false) {
            $ownerId = $this->getOwnerId();

            if ($ownerId == -2) {
                return "";
            }

            $owner = posix_getpwuid($ownerId);

            return $owner["name"];
        }

        if ($this->owner == null) {
            $ownerId = $this->getOwnerId();

            if ($ownerId == -2) {
                $this->owner = "";
            }

            $owner = posix_getpwuid($ownerId);

            $this->owner = $owner["name"];
        }

        return $this->owner;
    }
178708
public function getAuthority()
    {
        return ( $this->_user ? $this->_user . '@' : '') . $this->_host . (isset($this->_port) ? ':' . $this->_port : '');
    }
162208
public function getUser()
    {
        if ($this->_oUser == null) {
            $this->_oUser = parent::getUser();
        }

        return $this->_oUser;
    }
75590
public function owner()
    {
        $model = getenv('BRAINTREE_MODEL') ?: config('services.braintree.model', 'App\\User');

        $model = new $model;

        return $this->belongsTo(get_class($model), $model->getForeignKey());
    }
670417
private function decryptSymmetricKeyWithUserKey($entity)
    {
        $encryptedKey = $entity->getKey();
        $decryptedKey = null;
        $user = $this->getUser();

        if ($user instanceof PKEncryptionEnabledUserInterface && $userKey = $encryptedKey->getKey($user)) {
            $userKey = base64_decode($userKey);
            $privateKey = $this->getPrivateKey();
        }
        elseif ($this->accessChecker->canUseOwnerPrivateKey($entity, $user)) {
            // Check if the logged in user can decrpyt the data without private key
            $vivaUser = $entity->getUserProfile()->getUser();
            $userKey = base64_decode($encryptedKey->getKey($vivaUser));
            $privateKey = $this->keyStore->getPrivateKey($vivaUser);
        }
        else {
            return null;
        }

        $decryptedKey = $this->cryptographyProvider->decryptWithPrivateKey($userKey, $privateKey);

        return $decryptedKey;
    }
806570
def owner(self):
        
        obj = javabridge.call(self.jobject, "getOwner", "()Lweka/core/CapabilitiesHandler;")
        if obj is None:
            return None
        else:
            return JavaObject(jobject=obj)
601799
protected function getSessionKeyByOwner()
    {
        if ($this->sessionKey) {
            return $this->sessionKey;
        }

        if ($this->owner instanceof Controller) {
            return $this->owner->module->id;
        }

        return 'generic';
    }
489073
private function findKeyByUser(PKEncryptionEnabledUserInterface $user)
    {
        $userClass = $this->getUserClass($user);
        $userId = $user->getId();
        $key = $this->getKeyRepository()->findOneBy(array('userClass' => $userClass, 'userId' => $userId));

        return $key;
    }
143909
public function user()
    {
        if ($this->user !== null) {
            return $this->user;
        }

        if ($this->jwT->setRequest($this->request)->getToken() &&
            ($payload = $this->jwT->check(true)) &&
            $this->jwT->checkProvider($this->provider->getModel())
        ) {
            return $this->user = $this->provider->retrieveById($payload['sub']);
        }
    }