Added role validation for user creation and editing.