Development

#5738 (Doctring Admin Generator and credentials)

You must first sign up to be able to contribute.

Ticket #5738 (closed defect: invalid)

Opened 1 year ago

Last modified 1 year ago

Doctring Admin Generator and credentials

Reported by: FX Poster Assigned to: Jonathan.Wage
Priority: major Milestone:
Component: sfDoctrinePlugin Version: 1.2.2
Keywords: Cc:
Qualification: Unreviewed

Description

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'));
    }

Change History

01/31/09 06:13:07 changed by FX Poster

  • status changed from new to closed.
  • resolution set to invalid.

There was a problem in sfDoctrineGuardUser plugin...

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.