Blame view

common/modules/comment/rbac/ArtboxCommentUpdateOwnRule.php 405 Bytes
b82db04a   Yarik   test
1
2
3
4
5
6
7
8
9
10
11
12
13
  <?php
  
      namespace common\modules\comment\rbac;
  
      use yii\rbac\Rule;
  
      class ArtboxCommentUpdateOwnRule extends Rule
      {
  
          public $name = 'canCommentUpdateOwnArtbox';
  
          public function execute($user, $item, $params)
          {
8a551494   Yarik   test
14
15
16
              if($params['comment']->user_id == \Yii::$app->user->id) {
                  return true;
              }
2f324895   Yarik   test
17
              return false;
b82db04a   Yarik   test
18
19
20
          }
  
      }