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
Page 1 of 1
Role based access clarification needed
#2
Posted 16 February 2010 - 08:37 AM
Arvind, on 16 February 2010 - 03:47 AM, said:
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
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
#3
Posted 16 February 2010 - 11:49 AM
Arvind, on 16 February 2010 - 03:47 AM, said:
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
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.yiiframew...pics.auth#c1113
Just to answer your question: this bizRule checks that the 'current user id' equals the author id of the post.
#4
Posted 16 February 2010 - 02:34 PM
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
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
Share this topic:
Page 1 of 1

Help













