/** * Handle the search scenario for isActive, isRootUser and isSystemUser attributes. */ public function isAllowedToSetReadOnlyAttribute($attributeName) { if ($this->getScenario() == 'importModel' || $this->getScenario() == 'searchModel') { if (in_array($attributeName, array('isActive', 'isRootUser', 'isSystemUser'))) { return true; } else { return parent::isAllowedToSetReadOnlyAttribute($attributeName); } } }