Example #1
0
 public function isDisabled()
 {
     // if (Yii::$app->user->username !== 'admin') {
     //     return true;
     // }
     return parent::isDisabled();
 }
Example #2
0
 /**
  * Override isDisabled method if you need as shown in the
  * example below. You can override similarly other methods
  * like isActive, isMovable etc.
  */
 public function isDisabled()
 {
     if (!Yii::$app->user->can('admin')) {
         return true;
     }
     return parent::isDisabled();
 }
Example #3
0
 /**
  * Override isDisabled method if you need as shown in the  
  * example below. You can override similarly other methods
  * like isActive, isMovable etc.
  */
 public function isDisabled()
 {
     /*
     if (Yii::$app->user->role !== User::ROLE_ADMIN) {
         return true;
     }
     */
     return parent::isDisabled();
 }
Example #4
0
 /**
  * Override isDisabled method if you need as shown in the
  * example below. You can override similarly other methods
  * like isActive, isMovable etc.
  *
  * @return bool
  */
 public function isDisabled()
 {
     return parent::isDisabled();
 }