arbir
(Arvind Rangan)
February 16, 2010, 8:47am
1
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
bettor
(Live Webscore)
February 16, 2010, 1:37pm
2
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
dcolley
(Derek)
February 16, 2010, 4:49pm
3
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
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.
arbir
(Arvind Rangan)
February 16, 2010, 7:34pm
4
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