Commit Graph

9 Commits

Author SHA1 Message Date
evazion
33d81d0d1b pundit: convert post flags to pundit. 2020-03-20 18:03:01 -05:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
a1df1abf0b Fix #4020: Flagger name information leak. 2018-12-14 18:08:43 -06:00
evazion
bfecbffb97 post approvals: add to post events page. 2018-05-05 14:00:58 -05:00
BrokenEagle
5b4ab8d80e Disallow a user from seeing flagger's name on own uploads 2017-11-08 00:37:16 -08:00
Type-kun
1375cc5307 Added privilege check for seeing flagger usernames
Also reworked all places dealing with flagger names to use said privilege
2017-06-14 20:43:25 +05:00
evazion
47ecf034a7 /posts/:id/events - fix exception when viewed by mod.
NoMethodError exception raised

    undefined method `creator' for #<PostEvent:0x007f9a298e64d8> Did you mean? creator_id
    app/views/post_events/index.html.erb:23:in `block in _app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/views/post_events/index.html.erb:18:in `each'
    app/views/post_events/index.html.erb:18:in `_app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/controllers/post_events_controller.rb:6:in `index'
2017-03-21 17:17:18 -05:00
evazion
5ba1df5502 /posts/:id/events: list is_resolved correctly for appeals.
/posts/:id/events incorrectly lists appeals as always being resolved.
This is because events UNION together appeals and flags, which doesn't
quite work because for appeals is_resolved is a method, not an
attribute. is_resolved was hardcoded to true so it'd work in the UNION.

This changes PostEvent to be a wrapper object around PostFlag /
PostAppeal, instead of a UNION. PostEvent delegates everything to the
inner flag/appeals object, so that is_resolved works correctly.

Also, this incidentally fixes a problem with /posts/:id/event.xml not
serializing correctly.
2017-03-19 22:47:10 -05:00
r888888888
f483d0e7a8 add combined flag+appeal listing for posts #262 2015-07-28 15:45:01 -07:00