Indica si el usuario logueado tiene acceso a la definicion de un componente
@param Request $request
@param array $component
@return boolean
349759
public function userHasAccessToComponentDefinition($request, $component){
        if(isset($component['authorization-profiles']) && $component['authorization-profiles'] != ""){
            $profiles= str_replace(' ', '', $component['authorization-profiles']);
            $profiles= explode(',', $component['authorization-profiles']);
            $userProfile= $this->getUserProfiles($request);
            //Comprueba si el usuario logueado tiene o no multiples perfiles y en base a eso comprueba
            if(is_array($userProfile)){
                return (count(array_intersect($userProfile, $profiles)) > 0);
            }else{
                return in_array($userProfile, $profiles);
            }            
        }else{
            //Si no esta seteado o es vacio el componente es publico
            return TRUE;
        }
    }
540743
public function process(Request $request, FormInterface $form)
    {
        if ($request->isMethod('POST')) {
            $form->submit($request);
            if ($form->isValid()) {
                /** @var TextInterface $text */
                $text = $form->getData();
                foreach ($text->getTranslations() as $translation) {
                    $translation->setText($text);
                }
                $this->textManager->add($form->getData());

                return true;
            }
        }

        return false;
    }
1204598
protected function afterSaveElements(\Illuminate\Http\Request $request)
    {
        $this->getElements()->onlyActive()->each(function ($element) use ($request) {
            $element = $this->getElementContainer($element);

            if ($element instanceof FormElementInterface) {
                $element->afterSave($request);
            }
        });
    }
46775
public static function canBeUsedForRequest(Request $request)
    {
        $hasChunkParams = $request->has(static::KEY_CHUNK_NUMBER)
                          && $request->has(static::KEY_TOTAL_SIZE)
                          && $request->has(static::KEY_CHUNK_SIZE)
                          && $request->has(static::KEY_CHUNK_CURRENT_SIZE);

        return $hasChunkParams && self::checkChunkParams($request);
    }
30742
public function addComponent(self $component, $key = null)
    {
        if (null == $key) {
            $this->components[] = $component;
        } else {
            $this->components[$key] = $component;
        }
    }
1347193
protected static function providerEmbedInDomIsBroken(Request $request)
    {
        $class = self::getClassFromRequest($request);

        if (class_exists($class) && $request->match($class::getPatterns())) {
            return $class::embedInDomIsBroken();
        }

        // Fall-through default in case this called for an invalid class
        return false;
    }
1075582
public function checkRequestForArraySessions(Request $request)
	{
		if (is_null($this->reject)) return;

		if (call_user_func($this->reject, $request))
		{
			$this->manager->setDefaultDriver('array');
		}
	}
1243698
public function isAjaxRequest(Request $request)
    {
        $result = false;
        $requestedWith = $request->server->get('HTTP_X_REQUESTED_WITH');
        if (is_string($requestedWith) && strcasecmp($requestedWith, 'XMLHttpRequest') === 0) {
            $result = true;
        }

        return $result;
    }
94779
private function checkHeader(Request $request, $header)
    {
        if(empty($header))
        {
            return true;
        }
        return Imi::checkCompareRules($header, function($name) use($request){
            return $request->getHeaderLine($name);
        });
    }
404848
public function removeAction(Request $request)
    {
        $row = $this->findRowByRequest($request);
        $container = $row->getContainer();

        try {
            $this->getEditor()->getRowManager()->delete($row);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        // Stores id for front removal
        $removedId = $this->getViewBuilder()->buildRow($row)->getAttributes()->getId();

        $this->validate($container);
        $this->persist($container);

        $data = [
            'removed' => [$removedId],
            //'containers' => [$this->getViewBuilder()->buildContainer($container)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
437884
public function process(RequestInterface $request): bool
    {
        if (!$request->getMethod()->isPost()) {
            return false;
        }

        if ($this->checkOriginEnabled && !self::isValidOrigin($request)) {
            return false;
        }

        return $this->doProcess($request->getFormParameters(), $request->getUploadedFiles());
    }
137761
protected function saveElements(\Illuminate\Http\Request $request)
    {
        $this->getElements()->onlyActive()->each(function ($element) use ($request) {
            $element = $this->getElementContainer($element);

            if ($element instanceof FormElementInterface) {
                $element->save($request);
            }
        });
    }
1243870
private function getFilter(Request $request)
    {
        $success = false;
        $filter = null;
        if ($request->query->has('filter')) {
            $filter = $request->query->get('filter');
            $type = 'query';
        } elseif ($request->request->has('filter')) {
            $filter = $request->request->get('filter');
            $type = 'request';
        } elseif ($request->getMethod() === 'PUT') {
            $_PUT = json_decode($request->getContent(), true);
            if (!empty($_PUT['filter'])) {
                $filter = $_PUT['filter'];
                $type = 'put';
            }
        }

        if ($filter === null) {
            if ($this->container->getParameter('kernel.environment') === 'dev') {
                $value = new Response($this->get('translator')->trans('error.requestMustHasFilter', array(), 'ApoutchikaMediaBundle'), 500);
            } else {
                $value = new Response($this->get('translator')->trans('error.requestMustHasFilterProd', array(), 'ApoutchikaMediaBundle'), 500);
            }
        } elseif (!$this->get('apoutchika_media.filter')->has($filter)) {
            if ($this->container->getParameter('kernel.environment') === 'dev') {
                $value = new Response($this->get('translator')->trans('error.requestMustHasCorrectFilter', array(), 'ApoutchikaMediaBundle'), 500);
            } else {
                $value = new Response($this->get('translator')->trans('error.requestMustHasCorrectFilterProd', array(), 'ApoutchikaMediaBundle'), 500);
            }
        } else {
            $success = true;
            $value = $this->get('apoutchika_media.filter')->get($filter);
        }

        return array(
            'success' => $success,
            'value' => $value,
            'crypted' => $filter,
        );
    }
829264
public function userHasAccessToComponent($request, $componentName){
        $component= $this->context->getComponentsDefinition()[$componentName];
        return $this->userHasAccessToComponentDefinition($request, $component);
    }
657203
private function isFormRequest(Request $request)
    {
        $contentTypeParts = explode(';', $request->headers->get('Content-Type'));

        if (isset($contentTypeParts[0])) {
            return in_array($contentTypeParts[0], ['multipart/form-data', 'application/x-www-form-urlencoded']);
        }

        return false;
    }
601340
public function filterRequest(RequestInterface $request)
    {
        if ($this->pattern->matchRequest($request)) {
            $this->securityInterceptor->invoke();
            return true;
        }
        return false;
    }
758331
public function isAuthorised( Request $request )
    {
        $header = $request->headers->get( 'Authorization' );
        $context = new Context( EncryptionFactory::create( $this->algorithm ) );

        if ( $header ) {
            try{
                $this->token = $this->jwt->deserialize( $this->extractJwtFromHeader($header) );
            } catch ( \Exception $e ){
                return false;
            }
        }

        if ( $this->algorithm instanceof None ) {
            return false;
        }

        if( $this->isExpired() || !$this->hasUserId() || !$this->isAllowedAppId() ) {
            return false;
        }

        try {
            return $this->jwt->verify( $this->token, $context );
        } catch ( VerificationException $e ) {
            return false;
        }
    }