/**
  * Creates an instance of MediaController.
  *
  * @param ContainerInterface $app
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     if ($this->getApplication()) {
         $mediaClasses = $this->getApplication()->getAutoloader()->glob('Media' . DIRECTORY_SEPARATOR . '*');
         foreach ($mediaClasses as $mediaClass) {
             class_exists($mediaClass);
         }
     }
 }
 /**
  * @see BackBee\ApiBundle\Controller\ARestController::granted
  */
 protected function granted($attributes, $object = null, $message = 'Access denied')
 {
     try {
         parent::granted($attributes, $object);
     } catch (AccessDeniedException $e) {
         throw new AccessDeniedException('Acces denied: no "' . (is_array($attributes) ? implode(', ', $attributes) : $attributes) . '" rights for bundle ' . get_class($object) . '.');
     }
     return true;
 }