public function checkSecurity($rol,$parameters = null) {
        if($rol === null){
            throw $this->createAccessDeniedHttpException($this->trans($this->genericMessage));
        }
        $roles = $rol;
        if(!is_array($rol)){
            $roles = array($rol);
        }
        $valid = $this->getSecurityContext()->isGranted($roles,$parameters);
        foreach ($roles as $rol) {
            if(!$valid){
                throw $this->createAccessDeniedHttpException($this->buildMessage($rol));
            }
            $methodValidMap = $this->getMethodValidMap();
            if(isset($methodValidMap[$rol])){
                $method = $methodValidMap[$rol];
                $valid = call_user_func_array(array($this,$method),array($rol,$parameters));
            }
        }
    }