Yii Framework Forum: Filter problem - Yii Framework Forum

Jump to content

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

Filter problem Rate Topic: -----

#1 User is offline   Maro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 19-January 10

Posted 22 February 2010 - 02:31 AM

I'm facing the same problem with all the filters that I define by myself, even with rbac extensions.

I'm getting this error for example for the :

Filter "application.modules.rbac.components.RbacAccessControl" is invalid. Controller "PostController" does have the filter method "filterapplication.modules.rbac.components.RbacAccessControl".


I' hope that I'll get a fast reply plz:S
0

#2 User is offline   xmaks 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 21-September 09
  • Location:Czech Republic

Posted 22 February 2010 - 03:59 AM

I'm getting the same error when rbac filter is defined as inline filter in the PostController:
public function filters()
{
	return array(
		'rbac.components.RbacAccessControl',
	);
}


Try this configuration:
public function filters()
{
	return array(
		// 'accessControl', // controller must have a method filterAccessControl, see yii.web.CController
		array('rbac.components.RbacAccessControl'),
	);
}



Or you can write wrapper of RbacAccessControl in your (base)controller:
public function filterRbac($filterChain)
{
	Yii::import('rbac.components.RbacAccessControl');
	$filter = new RbacAccessControl;
	$filter->filter($filterChain);
}


then you can define filter as:
public function filters()
{
	return array(
		'rbac',
	);
}

Linux From Scratch, Apache/2.2.9, PHP/5.2.6, Mysql/5.0.51, Sqlite/3.5.9, Yii/1.1.0
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