anchor.diff:                        {Trimmed, parse_permission(Trimmed)}
                 end, RawPermissions).
   
  -parse_permissions_test() ->
  -    ?assertMatch(
  -       [{"cluster.admin!write", {[admin], write}},
  -        {"cluster.admin", error},
  -        {"admin!write", error}],
  -       parse_permissions("cluster.admin!write, cluster.admin, admin!write")),
  -    ?assertMatch(
  -       [{"cluster.bucket[test.test]!read", {[{bucket, "test.test"}], read}},
  -        {"cluster.bucket[test.test].stats!read", {[{bucket, "test.test"}, stats], read}}],
  -       parse_permissions(" cluster.bucket[test.test]!read, cluster.bucket[test.test].stats!read ")),
  -    ?assertMatch(
  -       [{"cluster.no_such_atom!no_such_atom", {['_unknown_'], '_unknown_'}}],
  -       parse_permissions("cluster.no_such_atom!no_such_atom")).
  -
   handle_check_permissions_post(Req) ->
       Body = Req:recv_body(),
       case Body of
  
positive.code:                         [iolist_to_binary(permission_to_iolist(Permission)) | Acc]
                  end, [], Permissions).
  
  format_permissions_test() ->
      Permissions = [{[{bucket, any}, views], write},
                     {[{bucket, "default"}], all},
  
negative.code: role_to_string({Role, [BucketName]}) ->
      lists:flatten(io_lib:format("~p[~s]", [Role, BucketName])).
  
  reply_bad_roles(Req, BadRoles) ->
      Str = string:join(BadRoles, ","),
      menelaus_util:reply_json(
  