@param ResourceRecord $resourceRecord

@return bool
513446
public function contains(ResourceRecord $resourceRecord): bool
    {
        foreach ($this->resourceRecords as $_item) {
            if ($_item === $resourceRecord) {
                return true;
            }
        }

        return false;
    }
214390
public function addAnswer(ResourceRecord $resourceRecord): Message
    {
        $this->answers[] = $resourceRecord;
        $this->header->setAnswerCount(count($this->answers));

        return $this;
    }
1156969
public function isEnabled(string $resourceClass = null, string $operationName = null, array $context = []): bool
    {
        return $this->getEnabled($context, $resourceClass, $operationName);
    }
36643
public function isManager(ResourceNode $resourceNode)
    {
        $token = $this->tokenStorage->getToken();

        // if user is anonymous return false
        if ('anon.' === $token) {
            return false;
        }

        $roleNames = array_map(function (RoleInterface $role) {
            return $role->getRole();
        }, $token->getRoles());

        $isWorkspaceUsurp = in_array('ROLE_USURPATE_WORKSPACE_ROLE', $roleNames);

        $workspace = $resourceNode->getWorkspace();

        //if we manage the workspace
        if ($workspace && $this->container->get('claroline.manager.workspace_manager')->isManager($workspace, $token)) {
            return true;
        }

        // If not workspace usurper
        if (!$isWorkspaceUsurp && $token->getUser() === $resourceNode->getCreator()) {
            return true;
        }

        if (in_array('ROLE_ADMIN', $roleNames)) {
            return true;
        }

        return false;
    }
72241
protected function addWildcardRecord(ResourceRecord $resourceRecord): void
    {
        $labels = explode('.', rtrim($resourceRecord->getName(), '.'));
        $labels = array_reverse($labels);

        $array = &$this->wildcardRecords;
        foreach ($labels as $label) {
            if ('*' === $label) {
                $array[$label][$resourceRecord->getClass()][$resourceRecord->getType()][] = $resourceRecord;
                break;
            }

            $array = &$array[$label];
        }
    }
409134
public function loadResourceLink($resourceLink)
    {

        $now = time();
        $resourceLink->created = $now;
        $resourceLink->updated = $now;

        return true;

    }
517121
public function hasLinkTo(ResourceNode $parent, ResourceNode $target)
    {
        $nodes = $this->resourceNodeRepo
            ->findBy(array('parent' => $parent, 'class' => 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut'));

        foreach ($nodes as $node) {
            $shortcut = $this->getResourceFromNode($node);
            if ($shortcut->getTarget() == $target) {
                return true;
            }
        }

        return false;
    }
1204897
public function has_hd_grant(RecordReferenceInterface $record)
    {

        $this->load_hd_grant();

        if (array_key_exists($record->getId(), $this->_rights_records_document)) {
            return true;
        }

        return false;
    }
1186950
public function isSitesResourceId($resourceId)
    {
        $needle = ResourceProvider::RESOURCE_SITES . '.';
        $length = strlen($needle);

        return (substr($resourceId, 0, $length) === $needle);
    }
604937
public static function encodeResourceRecord(ResourceRecord $rr): string
    {
        $encoded = self::encodeDomainName($rr->getName());
        if ($rr->isQuestion()) {
            return $encoded.pack('nn', $rr->getType(), $rr->getClass());
        }

        $data = RdataEncoder::encodeRdata($rr->getType(), $rr->getRdata());
        $encoded .= pack('nnNn', $rr->getType(), $rr->getClass(), $rr->getTtl(), strlen($data));

        return $encoded.$data;
    }
643320
public function isUnlocked(ResourceNode $resourceNode): bool
    {
        if ($resourceNode->getAccessCode()) {
            // check if the current user already has unlocked the resource
            // maybe store it another way to avoid require it each time the user session expires
            return !empty($this->session->get($resourceNode->getUuid()));
        }

        // the current resource does not require a code
        return true;
    }
712617
public function isRecordOriginModifiable()
    {
        $retVal = false;
        if ($this->isRecordOriginFlagSet()) {
            $retVal = $this->def->getService()->getRecordOriginModifiable();
        }

        return $retVal;
    }
742180
public function deleteResourceLink($resourcelink) {
        global $DB;

        $resourcelinkid = $resourcelink->getRecordId();

        // Delete any outstanding share keys for resource links for this consumer.
        $DB->delete_records($this->sharekeytable, ['resourcelinkid' => $resourcelinkid]);

        // Delete users.
        $DB->delete_records($this->userresulttable, ['resourcelinkid' => $resourcelinkid]);

        // Update any resource links for which this is the primary resource link.
        $records = $DB->get_records($this->resourcelinktable, ['primaryresourcelinkid' => $resourcelinkid]);
        foreach ($records as $record) {
            $record->primaryresourcelinkid = null;
            $DB->update_record($this->resourcelinktable, $record);
        }

        // Delete resource link.
        $DB->delete_records($this->resourcelinktable, ['id' => $resourcelinkid]);

        $resourcelink->initialize();

        return true;
    }
1086311
private function getResourceFromNode(ResourceNode $resourceNode)
    {
        /** @var AbstractResource $resource */
        $resource = $this->om
            ->getRepository($resourceNode->getClass())
            ->findOneBy(['resourceNode' => $resourceNode]);

        return $resource;
    }
559050
public function getResource($resourceId)
    {
        if (isset($this->resources[$resourceId])) {
            return $this->resources[$resourceId];
        }

        $dynamicResource = $this->dynamicResourceMapper($resourceId);

        if (!empty($dynamicResource)) {
            return $dynamicResource;
        }

        return null;
    }
1191826
public static function ResourceLoaderRegisterModules( \ResourceLoader $rl ){
		self::$_modulesRegistered = true;
		$rl->register( self::$modules );
    return true;
	}
261478
public function can($permissions, $resourceName = null, $resourceId = null)
    {
        return $this->caller()->can($permissions, $resourceName, $resourceId);
    }