ArtboxCommentUpdateOwnRule.php
405 Bytes
<?php
    namespace common\modules\comment\rbac;
    use yii\rbac\Rule;
    class ArtboxCommentUpdateOwnRule extends Rule
    {
        public $name = 'canCommentUpdateOwnArtbox';
        public function execute($user, $item, $params)
        {
            if($params['comment']->user_id == \Yii::$app->user->id) {
                return true;
            }
            return false;
        }
    }