Added logic that current user can enter/leave groups. Needs refactoring