Add "roles" to users admin API

This commit is contained in:
Maxim Filippov 2019-03-12 22:15:28 +03:00
commit 25eb6cf1cb
3 changed files with 30 additions and 10 deletions

View file

@ -6,6 +6,7 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do
use Pleroma.Web, :view
alias Pleroma.Web.MastodonAPI.Admin.AccountView
alias Pleroma.User.Info
def render("index.json", %{users: users, count: count, page_size: page_size}) do
%{
@ -19,7 +20,8 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do
%{
"id" => user.id,
"nickname" => user.nickname,
"deactivated" => user.info.deactivated
"deactivated" => user.info.deactivated,
"roles" => Info.roles(user.info)
}
end
end