Yii Framework Forum: Help ? something to include for hasRole - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help ? something to include for hasRole Rate Topic: -----

#1 User is offline   xsano33 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 31-August 10

Posted 27 September 2010 - 06:08 AM

Hi there, would you help me,
I tried to use "hasRole" code but does not work, it shows the following error:
Although login and user/role management seems to work. In the user/role management page, this hasRole function does work. Maybe I have to add some line in the configuration files?

Description

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

<?php $this->widget('zii.widgets.CMenu',array(
	'items'=>array(
	array('label'=>'Home', 'url'=>array('/site/index')),
	array('label'=>'Employee', 'url'=>array('/employee')),
	array('label'=>'Contact', 'url'=>array('/site/contact')),
	array('label'=>'Login', 'url'=>array('/user/user/login'), 'visible'=>Yii::app()->user->isGuest),
	array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
	array('label'=>'User Management', 'url'=>array('/user/user/admin'), 'visible'=>User::hasRole('admin'))
	),
	)); 
?>


yii version is 1.1.3 and User Management Module version is 0.4.
Thanks, hidenori
0

#2 User is offline   xsano33 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 31-August 10

Posted 27 September 2010 - 06:18 AM

Sorry, self-resolved.
In protected/config/main.php, I mistyped the following:
'import'=>array(
application.modules.user.models.*
)
as user.modules.*
After fixed, it worked.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users