Add logic for groups and users (next step).