[Backport] Fixing validation of email and role in memberships