Symfony1 symfony:后端操作的凭据
在模块的generator.yml中有:Symfony1 symfony:后端操作的凭据,symfony1,credentials,backend,Symfony1,Credentials,Backend,在模块的generator.yml中有: config: actions: _new: { credentials: [user] } 我已经覆盖了generator.yml中提到的动作“new” 这样: public function executeNew(sfWebRequest $request) { var_dump($this->getCredential()); $this->form = $this->configuration->get
config:
actions:
_new: { credentials: [user] }
我已经覆盖了generator.yml中提到的动作“new”
这样:
public function executeNew(sfWebRequest $request)
{
var_dump($this->getCredential());
$this->form = $this->configuration->getForm();
$this->Sedi = $this->form->getObject();
}
当我执行新操作时,我得到“null”。我希望得到“用户”
我做了“抄送”
有什么想法吗
Javier您可以使用
security.yml
来限制操作 生成器操作的“凭据”选项指定哪些凭据足以执行该操作。它不向执行者提供指定的凭据。您确定您已经拥有“用户”凭据吗?谢谢。无论如何,我与一个拥有凭证“admin”的用户登录(在“新建”操作中,我使用var_dump($this->getUser()->getCredentials());)检查了它),但我可以执行“新建”操作。。。我本以为不能执行它。。。我做了“抄送”。