Closed iadj closed 8 years ago
i'll add an example to the docs
Thanks @trntv looking forward to it
Hey @trntv, is there any update on this? I'm currently using if(Model::findOne(['user_id']=>Yii::$app->user->identity->id)
on every controller but I feel like the ownModelRule would be much more straightforward, except that I don't know how to implement it :tongue:
OwnModel
to OwnModelRule
Yii::$app->user->can('editOwnModel', ['model' => $model])
ownModelRule
seems really useful, but I can't find any documentation on how to use it. I've also looked at generic Yii2 RBAC tutorials but couldn't get it to work. Is there an example or documentation on how to use theownModelRule
to easily restrict certain actions to the creator of the model (i.e. author can only edit their own post)?