anchor.diff:  %% token/user/group_from_token doesn't exist in db.
   %% @end
   %%--------------------------------------------------------------------
  --spec join(UserId :: binary(), Macaroon :: macaroon:macaroon()) ->
  +-spec join(UserId :: od_user:id(), Macaroon :: macaroon:macaroon()) ->
       {ok, GroupId :: onedata_group:id()}.
   join(UserId, Macaroon) ->
       {ok, {group, GroupId}} = token_logic:consume(Macaroon),
  
positive.code: %% doesn't exist in db.
  %% @end
  %%--------------------------------------------------------------------
  -spec join_group(GroupId :: od_user:id(), Macaroon :: macaroon:macaroon()) ->
      {ok, GroupId :: onedata_group:id()} | {error, cycle_averted}.
  join_group(GroupId, Macaroon) ->
      {ok, {group, ParentGroupId}} = token_logic:consume(Macaroon),
  
negative.code: %% Throws exception when call to the datastore fails, or group/user doesn't exist.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_effective_privileges(GroupId :: od_group:id(), UserId :: od_user:id()) ->
      {ok, [privileges:group_privilege()]}.
  get_effective_privileges(GroupId, UserId) ->
      {ok, #document{value = #od_group{
  