If I generate an admin for some model (through doctrine:generate-admin) and there is no credentials to enter this module - I cannot enter it, because I'm always beed redirected to secure page.
That happens because of preExecute method in auto*Actions class:
public function preExecute()
{
...
if (!$this->getUser()->hasCredential($this->configuration->getCredentials($this->getActionName())))
{
$this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
}
...
}
If credentials are empty $this->configuration->getCredentials($this->getActionName()) returns an empty array, but $this->getUser()->hasCredential(array()) returns false. It must be something like that:
$credentials = $this->configuration->getCredentials($this->getActionName());
if (!empty($credentials) && !$this->getUser()->hasCredential($credentials))
{
$this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
}