cache the result from inGroup

Saves some sql queries

cc @PVince81 @karlitschek @DeepDiver1975