CakePHP:Auth->allowedActions() 和 Auth->allow(); 之间有什么区别?
Auth->allowedActions() 和 Auth->allow(); 之间有什么区别? ?
$this->Auth->allowedActions = array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls');
或者
$this->Auth->allow(array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls'));
What's the difference between Auth->allowedActions() and Auth->allow(); ?
$this->Auth->allowedActions = array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls');
Or
$this->Auth->allow(array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls'));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用allow() 向 allowedActions 添加更多操作(除了已有的操作之外)。而allow()的语法是
$this->Auth->allow('index','view');
use allow() to add more actions to the allowedActions (in addition to those already in there). And the syntax for allow() is
$this->Auth->allow('index','view');