Fixed restricted login by group

This only for 3.2, master has different implementation without this problem