This repository has been archived by the owner. It is now read-only.

JSON access to the moderation log #371

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
5 participants
@yole
Contributor

yole commented Mar 13, 2012

No description provided.

+ from r2.models.subreddit import Subreddit
+
+ if attr == "moderator":
+ return Account._byID36(thing.mod_id36).name

This comment has been minimized.

@spladug

spladug Mar 13, 2012

Contributor

I think this will leak the names of deleted accounts. Possibly need to use Wrapped here?

@spladug

spladug Mar 13, 2012

Contributor

I think this will leak the names of deleted accounts. Possibly need to use Wrapped here?

This comment has been minimized.

@yole

yole Mar 13, 2012

Contributor

Is that really a concern that one moderator will be able to see the deleted account of another moderator?

@yole

yole Mar 13, 2012

Contributor

Is that really a concern that one moderator will be able to see the deleted account of another moderator?

This comment has been minimized.

@kemitche

kemitche Mar 13, 2012

Contributor

Most things should be Wrapped() before grabbing data to send to the user, as that's the primary (though not sole) method used to ensure that data access is restricted to those with appropriate permissions.

@kemitche

kemitche Mar 13, 2012

Contributor

Most things should be Wrapped() before grabbing data to send to the user, as that's the primary (though not sole) method used to ensure that data access is restricted to those with appropriate permissions.

+ return time.mktime(thing.date.timetuple())
+ elif attr == "target":
+ result = dict((key, getattr(thing.target, key, None))
+ for key in ["_fullname", "name", "url", "author", "title"])

This comment has been minimized.

@chromakode

chromakode Mar 13, 2012

Contributor

Upon further inspection, can we grab all of these by using getattr(thing, 'target_'+key, None) instead of involving the target?

Should the "url" key be permalink (similar to thing.target_path)?

@chromakode

chromakode Mar 13, 2012

Contributor

Upon further inspection, can we grab all of these by using getattr(thing, 'target_'+key, None) instead of involving the target?

Should the "url" key be permalink (similar to thing.target_path)?

+
+
+class ModActionJsonTemplate(ThingJsonTemplate):
+ _data_attrs_ = dict(date="date",

This comment has been minimized.

@bboe

bboe Mar 13, 2012

Contributor

Perhaps there should be two date fields as with many of the other items which have created and created_utc.

@bboe

bboe Mar 13, 2012

Contributor

Perhaps there should be two date fields as with many of the other items which have created and created_utc.

@spladug

This comment has been minimized.

Show comment
Hide comment
@spladug

spladug Nov 20, 2012

Contributor

I'm closing this because it was implemented in 1ac5259. Sorry :(

Contributor

spladug commented Nov 20, 2012

I'm closing this because it was implemented in 1ac5259. Sorry :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.