main/core/Manager/Resource/ResourceRestrictionsManager.php
public function unlock(ResourceNode $resourceNode, $code = null)
    {
        //if a code is defined
        if ($accessCode = $resourceNode->getAccessCode()) {
            if (empty($code) || $accessCode !== $code) {
                $this->session->set($resourceNode->getUuid(), false);

                throw new InvalidDataException('Invalid code sent');
            }

            $this->session->set($resourceNode->getUuid(), true);
        }
    }
public function unlock(ResourceNode $resourceNode, $code = null)
    {
        //if a code is defined
        if ($accessCode = $resourceNode->getAccessCode()) {
            if (empty($code) || $accessCode !== $code) {
                $this->session->set($resourceNode->getUuid(), false);

                throw new InvalidDataException('Invalid code sent');
            }

            $this->session->set($resourceNode->getUuid(), true);
        }
    }
public function unlock ( ResourceNode $ resourceNode , $ code = null ) { //if a code is defined if ( $ accessCode = $ resourceNode -> getAccessCode ( ) ) { if ( empty ( $ code ) || $ accessCode !== $ code ) { $ this -> session -> set ( $ resourceNode -> getUuid ( ) , false ) ; throw new InvalidDataException ( 'Invalid code sent' ) ; } $ this -> session -> set ( $ resourceNode -> getUuid ( ) , true ) ; } }
Submits a code to unlock a resource.
NB. The resource will stay unlocked as long as the user session stay alive.

@param ResourceNode $resourceNode - The resource to unlock
@param string       $code         - The code sent by the user

@throws InvalidDataException - If the submitted code is incorrect
Submits a code to unlock a resource . NB . The resource will stay unlocked as long as the user session stay alive .