commit: a1c8aa4721de8f5edd7d69dcd745586df23f5a31
parent eab13fed3e6ba7edd7847fd00581b45dc4292af0
Author: Ilja <ilja@ilja.space>
Date: Sat, 18 Jun 2022 10:55:45 +0200
Remove function superuser?
Everything now happens with privileged?/2
Diffstat:
2 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
@@ -371,11 +371,6 @@ defmodule Pleroma.User do
defp privileged_for?(_, _, _), do: false
- @spec superuser?(User.t()) :: boolean()
- def superuser?(%User{local: true, is_admin: true}), do: true
- def superuser?(%User{local: true, is_moderator: true}), do: true
- def superuser?(_), do: false
-
@spec invisible?(User.t()) :: boolean()
def invisible?(%User{invisible: true}), do: true
def invisible?(_), do: false
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
@@ -1918,34 +1918,6 @@ defmodule Pleroma.UserTest do
end
end
- describe "superuser?/1" do
- test "returns false for unprivileged users" do
- user = insert(:user, local: true)
-
- refute User.superuser?(user)
- end
-
- test "returns false for remote users" do
- user = insert(:user, local: false)
- remote_admin_user = insert(:user, local: false, is_admin: true)
-
- refute User.superuser?(user)
- refute User.superuser?(remote_admin_user)
- end
-
- test "returns true for local moderators" do
- user = insert(:user, local: true, is_moderator: true)
-
- assert User.superuser?(user)
- end
-
- test "returns true for local admins" do
- user = insert(:user, local: true, is_admin: true)
-
- assert User.superuser?(user)
- end
- end
-
describe "invisible?/1" do
test "returns true for an invisible user" do
user = insert(:user, local: true, invisible: true)