anchor.diff:  t_assert_ldap(Count) ->
       ?assertEqual([{ldap_count, Count}], ets:lookup(state, ldap_count)).
   
  +t_assert_buckets(Expected, Actual) when is_atom(Actual) ->
  +    ?assertEqual(Expected, Actual);
   t_assert_buckets(Expected, Actual) ->
       t_print_ldap_count(),
       ActualNames = [Name || {Name, _} <- Actual],
  
positive.code:     Test =
          fun ({Auth, Expected, _LdapCount}) ->
                  t_start("Filter accessible buckets. Auth = ~p", [Auth]),
                  Buckets = filter_accessible_buckets(t_sample_buckets(), t_new_request(Auth)),
                  t_assert_buckets(Expected, Buckets)
                  %%t_assert_ldap(LdapCount)
          end,
  
negative.code: %% credentials
  filter_accessible_buckets(BucketsAll, Req) ->
      UserPassword = menelaus_auth:extract_auth(Req),
      case get_role(Req) of
          "admin" ->
              BucketsAll;
          "ro_admin" ->
              BucketsAll;
          _ ->
              F = bucket_auth_fun(UserPassword, true),
              [Bucket || Bucket <- BucketsAll, F(Bucket)]
      end.
  
  %% returns true if given bucket is accessible with current
  %% credentials. No auth buckets are always accessible. SASL auth
  