form fields based on user


On user create gii code, i would like to change the code to not show some fields in _form view.

ex= show id only is user logged in is admin user


This can be done by setting variables in your UserIdentity class on login.

However, you need to think about how you will handle validation rules on form submission. For instance, how will you handle required fields that you display to only certain users?

For that reason I would consider separating admin functionality from user.