Ejemplo n.º 1
0
 public function isGranted(Route $route, User $user)
 {
     if ($Ctrl = $route->getDefault('_controller')) {
         $Ctrl = str_replace(array('Bundle', 'Controller', 'Action'), '', $Ctrl);
         list(, $Bundle, , $C) = explode("\\", strtolower($Ctrl));
         list($Controller, $Action) = explode("::", $C);
     }
     foreach ($user->getRoles() as $Role) {
         if ($Role->isGranted($Bundle, $Controller, $Action) === TRUE) {
             return TRUE;
         }
     }
     return FALSE;
 }
 /**
  * {@inheritDoc}
  */
 public function __toString()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, '__toString', array());
     return parent::__toString();
 }