Access rules to prevent users to edit each other's posts


I want to give my users the option to modify their own posts. What is the best way to prevent other users to modify other’s posts?

So that A can modify a post written by A,

B can modify post written by B

but A CAN’T modify a post written by B

Is it something we must set in the AccessRules?

Thank you!

The answer lies within this page ->


In short:

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

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


HTH ;)

Great thanks!