CAuthManager and hierarchy

Hi !

I would like to create authorization using the CAuthManager.

I would like to create authorization for categories and sub categories and post. If a post has no authorization and it is inside a category having authorizations, then I would like to use the category authorizations for the post, is it possible ?

And the same for categories and sub categories, I would like sub categories inherits parent categories authorization.

Thank you. Have a nice day.

see this http://www.yiiframew…-access-control

Defining Authorization Hierarchy

in the example. you can use something like this


$bizRule='return MyClassSecurity::checkAccess(Yii::app()->user->id,$params["post"]->authID,$params["post"]->categoryID


$task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule);



and put the logic in the MyClassSecurity::checkAccess


Thank you Horacio. I understand your idea.