api/v2/admin/accounts: support 'permissions' param
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
8626a337f8
commit
ae763ff6cf
2 changed files with 5 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.AccountOperation do
|
|||
:permissions,
|
||||
:query,
|
||||
:string,
|
||||
"Filter for accounts with staff permissions (users that can manage reports). (not implemented yet)"
|
||||
"Filter for accounts with staff permissions (users that can manage reports)."
|
||||
),
|
||||
Operation.parameter(
|
||||
:role_ids,
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountController do
|
|||
%{}
|
||||
|> maybe_filter_origin(params)
|
||||
|> maybe_filter_status(params)
|
||||
|> maybe_filter_staff(params)
|
||||
|> maybe_filter_nickname(params)
|
||||
|> maybe_filter_name(params)
|
||||
|> maybe_filter_domain(params)
|
||||
|
|
@ -240,6 +241,9 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountController do
|
|||
defp maybe_filter_email(criteria, %{email: email} = _params),
|
||||
do: Map.put(criteria, :email, email)
|
||||
|
||||
defp maybe_filter_staff(criteria, %{permissions: "staff"} = _params),
|
||||
do: Map.put(criteria, :staff, true)
|
||||
|
||||
defp maybe_filter_staff(criteria, %{staff: staff} = _params),
|
||||
do: Map.put(criteria, :staff, staff)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue