Role based access clarification needed

Hello,

Can somebody post an example with explanation for RBAC.

i got the following line from here (http://tinyurl.com/yej3yla)

$bizRule=‘return Yii::app()->user->id==$params[“post”]->authID;’;

Can somebody please explain the meaning of this line ?

thanks

Arvind

$bizRule is your business rule which tells Yii if this business rule is true than allow access[or whatever] if it is false deny access. In this case if Yii::app()->user->id==$params["post"]->authID [Yii::app()->user->id equals to $params["post"]->authID] return true…therefore allow the user to do something that is associated with the above bizRule. Thats how much I can help given the length of code you have provided

hope this helps

bettor

It confused me too, so I clarified the RBAC with a ‘top-down’ explanation here: http://www.yiiframework.com/doc/guide/topics.auth#c1113

Just to answer your question: this bizRule checks that the ‘current user id’ equals the author id of the post.

yeah, the top down approach was great.

what i was not clear is this statement

$params["post"]->authID

what is this exactly ? with respect to what …

what exactly is $params["post"] ?

thanks

Arvind