Graylog2/graylog2-web-interface — pull request #100 by alexquick (2012-09-26 23:10:20+00:00)
Title: Api Fixes

1. Accessing disallowed streams for users who are not admins now returns a 403 and a json message rather than a redirect

2. Response format now just returns the plain attribute of Message to eliminate data duplication in the response

So:
```json
[
{
"file": "",
"total_result_count": null,
"deleted": null,
"line": -1,
"full_message": "Foos were barred\nHere is a stacktrace...",
"facility": "myapp-foobarrer",
"id": "bFHNxsOZTHWMS1kmZVIAlA",
"streams": [
"5012ab2969bd691a64000002",
"4f1632c81d4d8257a5000002"
],
"plain": {
"file": "",
"created_at": 1345683223.99498,
"level": 5,
"facility": "myapp-foobarrer",
"_score": null,
"_some_meta": "a value",
"message": "Foos were barred",
"_index": "graylog2",
"_version": null,
"_type": "message",
"host": "titan",
"line": -1,
"sort": [
1345683223.99498
],
"id": "bFHNxsOZTHWMS1kmZVIAlA",
"_account_id": "1",
"highlight": null,
"streams": [
"5012ab2969bd691a64000002",
"4f1632c81d4d8257a5000002"
],
"full_message": "Foos were barred\nHere is a stacktrace..."
},
"level": 5,
"host": "titan",
"created_at": 1345683223.99498,
"message": "Foos were barred"
},
. . .
]
```

Becomes:
```json
[
{
"file": "",
"created_at": 1345683223.99498,
"level": 5,
"facility": "myapp-foobarrer",
"_score": null,
"_some_meta": "a value",
"message": "Foos were barred",
"_index": "graylog2",
"_version": null,
"_type": "message",
"host": "titan",
"line": -1,
"sort": [
1345683223.99498
],
"id": "bFHNxsOZTHWMS1kmZVIAlA",
"_account_id": "1",
"highlight": null,
"streams": [
"5012ab2969bd691a64000002",
"4f1632c81d4d8257a5000002"
],
"full_message": "Foos were barred\nHere is a stacktrace..."
},
. . .
]
```