protected function isGranted($fileID)
    {
        // Since permissions are applied to the non-variant only,
        // map back to the original file before checking
        $parsedFileID = $this->getProtectedResolutionStrategy()->stripVariant($fileID);

        // Make sure our File ID got understood
        if ($parsedFileID && $originalID = $parsedFileID->getFileID()) {
            $session = Controller::curr()->getRequest()->getSession();
            $granted = $session->get(self::GRANTS_SESSION) ?: array();
            return !empty($granted[$originalID]);
        }

        // Our file ID didn't make sense
        return false;
    }
protected function isGranted($fileID)
    {
        // Since permissions are applied to the non-variant only,
        // map back to the original file before checking
        $parsedFileID = $this->getProtectedResolutionStrategy()->stripVariant($fileID);

        // Make sure our File ID got understood
        if ($parsedFileID && $originalID = $parsedFileID->getFileID()) {
            $session = Controller::curr()->getRequest()->getSession();
            $granted = $session->get(self::GRANTS_SESSION) ?: array();
            return !empty($granted[$originalID]);
        }

        // Our file ID didn't make sense
        return false;
    }
protected function isGranted ( $ fileID ) { // Since permissions are applied to the non-variant only, // map back to the original file before checking $ parsedFileID = $ this -> getProtectedResolutionStrategy ( ) -> stripVariant ( $ fileID ) ; // Make sure our File ID got understood if ( $ parsedFileID && $ originalID = $ parsedFileID -> getFileID ( ) ) { $ session = Controller :: curr ( ) -> getRequest ( ) -> getSession ( ) ; $ granted = $ session -> get ( self :: GRANTS_SESSION ) ? : array ( ) ; return ! empty ( $ granted [ $ originalID ] ) ; } // Our file ID didn't make sense return false ; }
Determine if a grant exists for the given FileID

@param string|ParsedFileID $fileID
@return bool
Determine if a grant exists for the given FileID