Commit Graph

16 Commits (a2c4f5f5c0de75fb67cee011b98c82e0d75f0fbd)

Author SHA1 Message Date
Matt Jankowski b5115850bb
Move repeated `insert_pagination_headers` method to api base class ()
Matt Jankowski 9754967d5f
Move `pagination_max_id` and `pagination_since_id` into api/base controller ()
Nick Schonning e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier ()
Francis Murillo f6492a7c4d
Log admin approve and reject account ()
* Log admin approve and reject account

* Add unit tests for approve and reject logging
Eugen Rochko 276b85bc91
Fix admin APIs returning deleted object instead of empty object upon delete ()
Fix 
Eugen Rochko 44b2ee3485
Add customizable user roles ()
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
Claire 3906dd67ed
Fix extremely rare race condition when deleting a toot or account ()
Claire 62c6e12fa5
Fix admin API unconditionally requiring CSRF token ()
Fixes 

Since , the admin API has only been available through the web
application because of the unconditional requirement to provide a valid CSRF
token.

This commit changes it back to `null_session`, which should make it work
both with session-based authentication (provided a CSRF token) and with a
bearer token.
Claire 894956e20c
Fix /api/v1/admin/accounts ()
* Fix /api/v1/admin/accounts

Compatibility was broken since  which changed the underlying filter class
without changing the controller.

This commits restore support for the old parameters.

* Add /api/v2/admin/accounts with the new parameters

* Add tests

* Add missing filter for `silenced` status

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Eugen Rochko 14f436c457
Add notifications for statuses deleted by moderators ()
Eugen Rochko 8e84ebf0cb
Remove IP tracking columns from users table ()
Takeshi Umeda d6fe0c94ca
Add account sensitized ()
* Add account sensitized

* Fix i18n normalize

* Fix description and spec

* Fix spec

* Fix wording
Eugen Rochko ed099d8bdc
Change account suspensions to be reversible by default ()
Akihiko Odaki ae871c4d46
Make Array-creation behavior of Paginable more predictable ()
* Make Array-creation behavior of Paginable more predictable

Paginable.paginate_by_id usually returns ActiveRecord::Relation, but it
returns an Array if min_id option is present. The behavior caused problems
fixed with the following commits:
- 552e886b64
- b63ede5005
- 64ef37b89d

To prevent from recurring similar problems, this commit introduces two
changes:
- The scope now always returns an Array whether min_id option is present
  or not.
- The scope is renamed to to_a_paginated_by_id to clarify it returns an
  Array.

* Transform Paginable.to_a_paginated_by_id from a scope to a class method

https://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope
> The method is intended to return an ActiveRecord::Relation object, which
> is composable with other scopes.

Paginable.to_a_paginated_by_id returns an Array and is not appropriate
as a scope.
Eugen Rochko c5d37f18cb
Change deletes to preserve soft-deleted statuses in unresolved reports ()
Change all account actions except "none" to resolve all unresolved reports

Refactor `SuspendAccountService` to be more readable
Eugen Rochko 7696f77245
Add moderation API ()
Fix 
Fix