anchor.diff:  get_space_support_token(SID, ReqParams) ->
       {RestAddress, Headers, Options} = ReqParams,
       Response = do_request(
  -        RestAddress ++ "/spaces/" ++ binary_to_list(SID) ++"/providers/token", Headers, get, [], Options
  +        RestAddress ++ "/spaces/" ++ binary_to_list(SID) ++"/providers/token",
  +        Headers, get, [], Options
       ),
       [Token] = get_body_val([token], Response),
       Token.
  
positive.code: %%         check_status(update_group(GID, ?GROUP_NAME2, UserReqParams2))
  %%     ),
  %%
  %%     ?PRINT("SETTING PRIVILEGES"),
  %% %% TODO uncomment below lines after finding bug in setting priviliges
  %%
  %% %%     set_group_user_privileges(GID, UserId2, [group_change_data], UserReqParams1),
  %% %%
  %% %%     ?assertMatch(
  %% %%         ok,
  %% %%         check_status(update_group(GID, ?GROUP_NAME2, UserReqParams2))
  %% %%     ),
  %%     get_group_user_privileges(GID, UserId1, UserReqParams1),
  %%     get_group_user_privileges(GID, UserId2, UserReqParams1),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %% group_privileges_check(group_invite_user, UserData1, UserData2, GID, _SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%      %% test if user2 lacks group_invite_user privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(get_group_invitation_token(GID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_invite_user], UserReqParams1),
  %%
  %%     ?assertNotMatch(
  %%         ok,
  %%         get_group_invitation_token(GID, UserReqParams2)
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %% group_privileges_check(group_set_privileges, UserData1, UserData2, GID, _SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%      %% test if user2 lacks group_set_privileges privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(set_group_user_privileges(GID, UserId1, ?GROUP_PRIVILEGES, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_set_privileges], UserReqParams1),
  %%
  %%     ?assertMatch(
  %%         ok,
  %%         check_status(set_group_user_privileges(GID, UserId1, ?GROUP_PRIVILEGES, UserReqParams2))
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %%
  %% group_privileges_check(group_join_space, UserData1, UserData2, GID, SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%     InvitationToken = get_space_invitation_token(groups, GID, UserReqParams2),
  %%
  %%      %% test if user2 lacks group_join_space privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(join_group_to_space(InvitationToken, SID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_join_space], UserReqParams1),
  %%
  %%     ?assertMatch(
  %%         SID,
  %%         check_status(join_group_to_space(InvitationToken, GID, UserReqParams2))
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %%
  %% group_privileges_check(group_leave_space, UserData1, UserData2, GID, SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%     InvitationToken = get_space_invitation_token(groups, SID, UserReqParams2),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_join_space], UserReqParams1),
  %%
  %%     ?assertMatch(
  %%         ok,
  %%         check_status(join_group_to_space(InvitationToken, GID, UserReqParams2))
  %%     ),
  %%     %% test if user2 lacks group_leave_space privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(group_leave_space(GID, SID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_join_space, group_leave_space], UserReqParams1),
  %%     ?assertMatch(
  %%         ok,
  %%         check_status(group_leave_space(GID, SID, UserReqParams2))
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %%
  %% group_privileges_check(group_create_space_token, UserData1, UserData2, GID, SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%     %% test if user2 lacks group_create_space_token privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(get_space_creation_token_for_group(GID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_create_space_token, group_leave_space], UserReqParams1),
  %%
  %%     ?assertNotMatch(
  %%         bad,
  %%         check_status(get_space_creation_token_for_group(GID, UserReqParams2))
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %%
  %% group_privileges_check(group_create_space_token, UserData1, UserData2, GID, SID) ->
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%     %% test if user2 lacks group_create_space_token privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(create_space_for_group(?SPACE_NAME2, GID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_create_space], UserReqParams1),
  %%
  %%     ?assertNotMatch(
  %%         bad,
  %%         check_status(create_space_for_group(?SPACE_NAME2, GID, UserReqParams2))
  %%     ),
  %%     clean_privileges(GID, UserId2, UserReqParams1);
  %%
  %% group_privileges_check(group_remove_user, UserData1, UserData2, GID, _SID) ->
  %%     group_privileges_check(group_remove, UserData1, UserData2, GID, _SID);
  %%
  %% group_privileges_check(group_remove, UserData1, UserData2, GID, _SID) ->
  %%
  %%     {UserId1, UserReqParams1} = UserData1,
  %%     {UserId2, UserReqParams2} = UserData2,
  %%
  %%     %% test if user2 lacks group_remove_user privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(delete_group_user(GID, UserId1, UserReqParams2))
  %%     ),
  %%
  %%     %% test if user2 lacks group_remove privileges
  %%     ?assertMatch(
  %%         bad,
  %%         check_status(delete_group(GID, UserReqParams2))
  %%     ),
  %%
  %%     set_group_user_privileges(GID, UserId2, [group_remove_user, group_remove], UserReqParams1),
  %%
  %%     %% test if user2 lacks group_remove_user privileges
  %%     ?assertMatch(
  %%         ok,
  %%         check_status(delete_group_user(GID, UserId1, UserReqParams2))
  %%     ),
  %%
  %%     %% test if user2 lacks group_remove privileges
  %%     ?assertMatch(
  %%         ok,
  %%         check_status(delete_group(GID, UserReqParams2))
  %%     ).
  
  clean_group_privileges(GID, UserId, ReqParams) ->
      set_group_user_privileges(GID, UserId, [group_view_data], ReqParams).
  
negative.code:      %% create users
      UserId1 = create_user(?USER_NAME1, Node),
      UserId2 = create_user(?USER_NAME2, Node),
      UserId3 = create_user(?USER_NAME3, Node),
  
      %% authenticate users
      NewHeaders = auth_user(UserId1, ProviderId, ReqParams, Node),
      UserReqParams1 = update_req_params(ProviderReqParams, NewHeaders, headers),
      NewHeaders2 = auth_user(UserId2, ProviderId, ReqParams, Node),
      UserReqParams2 = update_req_params(ProviderReqParams, NewHeaders2, headers),
      NewHeaders3 = auth_user(UserId3, ProviderId, ReqParams, Node),
      UserReqParams3 = update_req_params(ProviderReqParams, NewHeaders3, headers),
  
      GID = create_group(?GROUP_NAME1, UserReqParams1),
  
  