| @@ 312-314 (lines=3) @@ | ||
| 309 | */ | |
| 310 | public function getPermission() | |
| 311 |     { | |
| 312 |         if (!Yii::$app->user->can('editor') && $this->author !== Yii::$app->user->id) { | |
| 313 | return false; | |
| 314 | } | |
| 315 | ||
| 316 | return true; | |
| 317 | } | |
| @@ 111-113 (lines=3) @@ | ||
| 108 | ]); | |
| 109 | }, | |
| 110 |                     'update' => function ($url, $model) { | |
| 111 |                         if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) { | |
| 112 | return ''; | |
| 113 | } | |
| 114 | ||
| 115 |                         return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |
| 116 |                             'title' => Yii::t('yii', 'Update'), | |
| @@ 121-123 (lines=3) @@ | ||
| 118 | ]); | |
| 119 | }, | |
| 120 |                     'delete' => function ($url, $model) { | |
| 121 |                         if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) { | |
| 122 | return ''; | |
| 123 | } | |
| 124 | ||
| 125 |                         return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | |
| 126 |                             'title' => Yii::t('yii', 'Delete'), | |