anchor.diff:                       case PathTokens of
                            [] -> {done, redirect_permanently("/index.html", Req)};
                            ["pools"] ->
  -                             {need_auth, fun handle_pools/1};
  +                             {need_auth_bucket, fun handle_pools/1};
                            ["pools", Id] ->
  -                             {need_auth, fun handle_pool_info/2, [Id]};
  +                             {need_auth_bucket, fun handle_pool_info/2, [Id]};
                            ["pools", Id, "stats"] ->
                                {need_auth, fun handle_bucket_stats/3, ["asd", Id]};
                            ["poolsStreaming", Id] ->
                                {need_auth, fun handle_pool_info_streaming/2, [Id]};
                            ["pools", PoolId, "buckets", Id] ->
  -                             {need_auth, fun handle_bucket_info/3, [PoolId, Id]};
  +                             {need_auth_bucket, fun handle_bucket_info/3, [PoolId, Id]};
                            ["pools", PoolId, "buckets", Id, "stats"] ->
                                {need_auth, fun handle_bucket_stats/3, [PoolId, Id]};
                            ["alerts"] ->
  
positive.code: %   ]}
  % ]}
  
  build_pool_info(Id) ->
      MyPool = find_pool_by_id(Id),
      Buckets = expect_prop_value(buckets, MyPool),
      Nodes = build_nodes_info(MyPool, true),
      BucketsInfo = [{struct, [{uri, list_to_binary("/pools/" ++ Id ++ "/buckets/" ++ Name)},
                               {name, list_to_binary(Name)}]}
                     || Name <- proplists:get_keys(Buckets)],
      {struct, [{name, list_to_binary(Id)},
  
negative.code: % {rest_creds, [{creds, [{"user", [{password, "password"}]},
  %                        {"admin", [{password, "admin"}]}]}
  %              ]}. % An empty list means no login/password auth check.
  
  check_bucket_auth({User, Password}) ->
      % Default pool only for 1.0.
      case ns_config:search_prop(ns_config:get(), pools, "default", empty) of
          empty -> false;
          Pool ->
              Buckets = proplists:get_value(buckets, Pool),
              lists:any(bucket_auth_fun(User, Password),
                        Buckets)
      end.
  
  check_auth(UserPassword) ->
      case ns_config:search_prop(ns_config:get(), rest_creds, creds, empty) of
  