Moderators.json Requires Authorization
-
In the Trust Levels FAQ, when clicking the link to access the list of Moderator users, the following text appears:
Access Denied
while trying to load /groups/moderators.jsonThis occurs at my trust level (Basic). None of the other trust level links in said FAQ have this problem.
-
Another day, another bug...
Ta.
-
.. but, strangely, not reproducible over at meta.d..
(Visit http://what.thedailywtf.com/groups/moderators/members while not logged in - get "Access Denied". http://what.thedailywtf.com/groups/admins/members and http://what.thedailywtf.com/groups/staff/members (e.g.) are accessible.Fixed
-
Happens at TL3 too
-
-
Happens at TL4 too.
-
http://what.thedailywtf.com/groups/moderators.json
[error: 'invalid access']
- WTF is an “invalid access”?
- How did they manage to produce such invalid JSON? (
[
instead of{
, and'
instead of"
, no quotes arounderror
)
-
How did they manage to produce such invalid JSON? ([ instead of {, and ' instead of ", no quotes around error)
"I'll make a Discourse API", I said. "How hard could it be?", I asked.
Fun times ahead it seems...
-
-
Yep, I get:
[error: 'invalid access']
-
Is Moderators an actual group?? I see the same error on http://what.thedailywtf.com/groups/aGroupThatDoesntExist
-
Is Moderators an actual group??
Yes.
http://what.thedailywtf.com/groups/moderators.json
{"basic_group":{"id":2,"automatic":true,"name":"moderators","user_count":9,"alias_level":2,"visible":false,"automatic_membership_email_domains":null,"automatic_membership_retroactive":false}}
http://what.thedailywtf.com/groups/moderators/members
Compare https://meta.discourse.org/groups/moderators/members
-
-
-
-
-
-
-
Why are there so many moderators that don't visit the site? Wouldn't it make sense to replace them with actual users?
-
How come @boomzilla couldn't see it? Even members of the group were excluded?
-
Even members of the group were excluded?
The oft-cited example I've seen on meta.d is survivors' boards - you don't necessarily want/need to see other members of the group.
-
How did they manage to produce such invalid JSON?
i don't kow but that is extreely annoying for working with them for @sockbot.
-
Yes mistress Commander @Accalia Shepard, I shall appear as summoned.
-
-
How did they manage to produce such invalid JSON?
"I'll make a Discourse API", I said. "How hard could it be?", I asked.
Pretty hard. As I said, I need to dig that project out of its grave...
-
Pretty hard. As I said, I need to dig that project out of its grave...
Well, as soon as my code reaches a level where I'm not embarrassed with it I'm gonna push it to GitHub as well. Working out some kinks ATM. I actually reached the limits of my knowledge of network connection management in Qt so I have some reading to do first.
-
Well, as soon as my code reaches a level where I'm not embarrassed with it I'm gonna push it to GitHub as well.
As you can see, I didn't wait that long.
Qt
Wait, you're doing it in Qt? May Gods have mercy on your soul.
-
Wait, you're doing it in Qt? May Gods have mercy on your soul.
No mercy for the wicked.
The main thing I personally want to do with it is use it to make an Android app, since we know how well Discourse works there. So, if I want to leave with any sanity remaining it's either HTML5, Java, or Qt. And I sure as hell am not learning Java.
-
So, if I want to leave with any sanity remaining it's either HTML5, Java, or Qt.
Xamarin? Hell, you can even fork mine if you redo the incompatible parts...
HTML5 + JS would at least make the task of parsing the damn thing somewhat easier. Java is, well, Java, but it would probably still cost you lest effort than Qt (does C++/Qt even have a sensible JSON parser?).
-
does C++/Qt even have a sensible JSON parser?
// Given reply is a QNetworkReplyObject: QByteArray response = reply->readAll(); QVariantMap JSON = QJsonDocument::fromJson(response).toVariant().toMap();
Gives you a nice map with a string as a key and a QVariant (generic container, you can just call
.toWhatever()
on it at any point) as value.Edit: That was the completely wrong link. How did I even copy that from Google?
-
Gives you a nice map with a string as a key and a QVariant (generic container, you can just call .toWhatever() on it at any point) as value.
Hm, that's something... Still, be careful what you .toWhatever() it to - Discourse's API is, as you'd expect, not very consistent about the data types.
C# does it either on
dynamic
s, or POCOs, which I find much nicer, but guess a dictionary would work too.
-
Still, be careful what you .toWhatever() it to - Discourse's API is, as you'd expect, not very consistent about the data types.
I figured. There is a
::canConvert()
, but still, extra precautions should be taken when Discourse is concerned.