我在Laravel4和授权( https://github.com/machuga/authority-l4 )中定义能力时遇到问题。authority config中的规则应该有效:
$authority->allow('manage', 'Post', function($self, $post){
// return ($post->sth ... )
});但问题出在$post,它总是为空。
发布于 2014-02-17 05:51:46
试着这样传递它:
$authority->allow('manage', 'Post', function($self) use ($post) {
// return ($post->sth ... )
});https://stackoverflow.com/questions/21817159
复制相似问题