anchor.diff:      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
  
positive.code:         end
      end, [], GIDs).
  
  gather_users_groups(Users) ->
      lists:foldl(fun(UID, Acc) ->
          case onedata_user:get(UID) of
  
negative.code:             {[], []} -> {error, update_not_needed};
              _ -> {ok, Group#user_group{effective_groups = Effective}}
          end
      end), ok.
  
  -spec update_effective_users(GroupID :: binary(), effective_users()) -> ok.
  update_effective_users(ID, Effective) ->
      user_group:update(ID, fun(Group) ->
          Current = ordsets:from_list(Group#user_group.effective_users),
  