Commit Graph

27 Commits

Author SHA1 Message Date
evazion
ca742db07a routes: remove legacy /user/index and /artist/index API endpoints.
These endpoints get zero traffic.
2020-12-24 00:17:26 -06:00
evazion
caf54fe45a blacklists: remove ability for mods to blacklist uploaders by name. 2020-02-16 04:00:42 -06:00
BrokenEagle
63b3503bfc Add ability to use nested only parameter
- The only string works much the same as before with its comma separation
-- Nested includes are indicated with square brackets "[ ]"
-- The nested include is the value immediately preceding the square brackets
-- The only string is the comma separated string inside those brackets
- Default includes are split between format types when necessary
-- This prevents unnecessary includes from being added on page load
- Available includes are those items which are allowed to be accessible to the user
-- Some aren't because they are sensitive, such as the creator of a flag
-- Some aren't because the number of associated items is too large
- The amount of times the same model can be included to prevent recursions
-- One exception is the root model may include the same model once
--- e.g. the user model can include the inviter which is also the user model
-- Another exception is if the include is a has_many association
--- e.g. artist urls can include the artist, and then artist urls again
2020-02-12 23:58:53 +00:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
601e58d5c5 Fix exception in legacy /post/index.xml endpoint.
Fixes intermittent `uninitialized constant LegacyController::Builder` exceptions.
2019-08-12 19:20:33 -05:00
evazion
235271706b Fix #3913: Remove legacy /post/create.xml endpoint. 2018-09-20 12:25:16 -05:00
Albert Yi
eddc789df2 fix js bugs 2018-04-26 15:01:57 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
67528ce5ab Fix hidden attribute leaks in legacy post controller (#3237). 2017-07-24 20:35:12 -05:00
evazion
40092f21ba Remove redundant rescue_from calls.
These are redundant because ApplicationController rescues these exceptions already.
2017-02-25 02:18:16 -06:00
r888888888
6ad6aa44c4 fixes #2432, fix tests 2015-07-14 15:13:04 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
f0b29fc3ba more intelligent queuing of async jobs 2013-03-03 01:12:31 -05:00
albert
207001655d fix tag legacy api limit 2013-02-28 21:48:48 -08:00
albert
abefc91a42 add legacy artist xml api 2013-02-23 12:15:23 -05:00
albert
ae6e8fce30 unified error handling system 2013-02-22 14:45:39 -05:00
albert
bbb8767b29 make forum post quoting regexp nongreedy 2013-02-22 12:24:10 -05:00
albert
804055aac7 fix for rating 2013-02-21 18:29:59 -05:00
albert
c6d0a28514 fix for danbooruup 2013-02-20 23:07:13 -05:00
albert
13ebfeacb6 fix ordering of notes 2013-02-20 22:40:33 -05:00
albert
f864272763 intiialize new users to level 20 2013-02-20 02:12:25 -05:00
albert
5f6cb744a3 implement xml response for legacy post create action 2013-02-20 01:23:08 -05:00
albert
5ac578adf3 expire favorite/list_users.json 2013-02-17 01:58:32 -05:00
albert
74c0cee5ee routing fixes 2013-02-17 00:59:19 -05:00
albert
e0c563373a added more legacy api endpoints 2013-01-22 17:42:00 -05:00
albert
0cd009df24 changes to limit 2013-01-14 16:04:05 -05:00
albert
7aca7f3e2f added legacy api for posts 2011-12-22 12:39:27 -05:00