Add is_admin and is_moderator boolean fields to the user view
authoreugenijm <eugenijm@protonmail.com>
Mon, 4 Feb 2019 02:03:57 +0000 (05:03 +0300)
committereugenijm <eugenijm@protonmail.com>
Tue, 5 Feb 2019 23:10:06 +0000 (02:10 +0300)
lib/pleroma/web/twitter_api/views/user_view.ex
test/web/twitter_api/views/user_view_test.exs

index cd7c4349c7645388b40275e068cd925a799f9855..2a0cc5c0f4588fdec719a6ea5485f3f7e9064fb8 100644 (file)
@@ -105,6 +105,8 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "cover_photo" => User.banner_url(user) |> MediaProxy.url(),
       "background_image" => image_url(user.info.background) |> MediaProxy.url(),
       "is_local" => user.local,
+      "is_moderator" => user.info.is_moderator,
+      "is_admin" => user.info.is_admin,
       "locked" => user.info.locked,
       "default_scope" => user.info.default_scope,
       "no_rich_text" => user.info.no_rich_text,
index 0885afaec3e0c4ac205a8400953c0bd5f54acb19..637b84d726a1e50be82bdfee46019a153f2e5a98 100644 (file)
@@ -97,6 +97,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "cover_photo" => banner,
       "background_image" => nil,
       "is_local" => true,
+      "is_admin" => false,
+      "is_moderator" => false,
       "locked" => false,
       "default_scope" => "public",
       "no_rich_text" => false,
@@ -145,6 +147,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "cover_photo" => banner,
       "background_image" => nil,
       "is_local" => true,
+      "is_admin" => false,
+      "is_moderator" => false,
       "locked" => false,
       "default_scope" => "public",
       "no_rich_text" => false,
@@ -194,6 +198,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "cover_photo" => banner,
       "background_image" => nil,
       "is_local" => true,
+      "is_admin" => false,
+      "is_moderator" => false,
       "locked" => false,
       "default_scope" => "public",
       "no_rich_text" => false,
@@ -257,6 +263,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "cover_photo" => banner,
       "background_image" => nil,
       "is_local" => true,
+      "is_admin" => false,
+      "is_moderator" => false,
       "locked" => false,
       "default_scope" => "public",
       "no_rich_text" => false,