anchor.diff:  %%% Internal: Conditional updates
   %%%===================================================================
   
  +-spec update_effective_groups(GroupID :: binary(), effective_groups()) -> ok.
   update_effective_groups(ID, Effective) ->
       user_group:update(ID, fun(Group) ->
           Current = ordsets:from_list(Group#user_group.effective_groups),
  
positive.code:     end, AffectedUsers),
      ok.
  
  gather_user_effective_groups_context(GIDs) ->
      AffectedUsers = gather_affected_users(GIDs),
      RequiredGroupsIDs = gather_users_groups(AffectedUsers),
      EffectiveGroupsMap = gather_effective_groups(RequiredGroupsIDs),
      {AffectedUsers, EffectiveGroupsMap}.
  
  gather_affected_users(GIDs) ->
      lists:foldl(fun(GID, UsersList) ->
          case user_group:get(GID) of
  
negative.code:         end
      end, [], Users).
  
  -spec gather_effective_groups(GIDs :: [binary()]) ->
      EffectiveGroupsMap :: #{GID :: binary() => effective_groups()}.
  gather_effective_groups(GIDs) ->
      lists:foldl(fun(GID, GroupsMap) ->
          case maps:get(GID, GroupsMap, undefined) of
  