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