/** * Override to handle special cases for the user status attribute. * @see DetailsView::resolveElementInformationDuringFormLayoutRender() */ protected function resolveElementInformationDuringFormLayoutRender(&$elementInformation) { if ($elementInformation['type'] == 'DerivedUserStatus' && !UserStatusUtil::canUserEditStatusOnAnotherUser(Yii::app()->user->userModel, $this->model)) { $elementInformation['type'] = 'ReadOnlyDerivedUserStatus'; } if ($elementInformation['attributeName'] == 'role' && !RightsUtil::canUserAccessModule('RolesModule', Yii::app()->user->userModel)) { $elementInformation['type'] = 'ReadOnlyModel'; } }