public function isDisabled() { // if (Yii::$app->user->username !== 'admin') { // return true; // } return parent::isDisabled(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }