Yii YUM用户管理用户:: hasRole()

时间:2013-10-31 15:45:36

标签: php yii yii-extensions

我正在尝试使用Yii扩展用户管理的hasRole()方法来验证登录用户的角色。

我严格遵循官方文件https://github.com/thyseus/yii-user-management/blob/master/user/docs/install_tutorial.txt

User::hasRole('admin')

然而我收到了PHP警告

include(User.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory 

在main.php配置文件中正确调用了Yum模块 我也尝试过使用YumUser :: hasRole()

1 个答案:

答案 0 :(得分:1)

我发现使用我拥有的特定版本的YUM(版本0.8),我必须调用不同模型的方法,尽管该版本的文档说明不然

YumWebUser::hasRole('role_name')
相关问题