private function checkWidgetCredentials($module = null, $action = null)
 {
     $action_name = $action === null ? $this->context->getActionName() : $action;
     $module = $module === null ? $this->context->getModuleName() : $module;
     $configUtils = new afConfigUtils($module);
     $path = $configUtils->getConfigFilePath($action_name . '.xml', true);
     /**
      * quick fix for symfony credentials
      */
     return ComponentCredential::actionHasCredential($module, $action_name);
     $this->readXmlDocument($path, true);
     $permissions = $this->fetch("//s:permissions[@for='" . $action_name . "']");
     if (!$permissions->length) {
         return true;
     }
     $url = $this->getnode("url", $this->document->documentElement);
     $rights = $this->fetch("./s:right", $permissions->item(0));
     $credentials = "";
     foreach ($rights as $right) {
         $r = $this->get($right, "name");
         if ($r == "*") {
             return true;
         }
         $credentials .= $this->get($right, "name") . ",";
     }
     if ($this->checkCredentials($credentials) === false) {
         if ($this->type === self::PANEL || $this->type === self::WIZARD) {
             $actionInstance->redirect($url ? $this->get($url) : sfConfig::get("app_parser_denied"));
         } else {
             return false;
         }
     }
 }