From c0e4b1b3e27a4a8f8f02ea6a33b76c6f2a386d95 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sat, 2 Jul 2022 07:52:39 +0200 Subject: [PATCH] Fix typo's priviledge |-> privilege --- config/description.exs | 4 ++-- docs/installation/migrating_from_source_otp_en.md | 2 +- docs/installation/otp_en.md | 2 +- lib/pleroma/web/plugs/ensure_privileged_plug.ex | 6 +++--- test/pleroma/web/plugs/ensure_privileged_plug_test.exs | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/description.exs b/config/description.exs index e5a49139e..e2ff91fb3 100644 --- a/config/description.exs +++ b/config/description.exs @@ -976,7 +976,7 @@ config :pleroma, :config_description, [ :emoji_manage_emoji ], description: - "What extra priviledges to allow admins (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)" + "What extra privileges to allow admins (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)" }, %{ key: :moderator_privileges, @@ -994,7 +994,7 @@ config :pleroma, :config_description, [ :emoji_manage_emoji ], description: - "What extra priviledges to allow moderators (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)" + "What extra privileges to allow moderators (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)" }, %{ key: :birthday_required, diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index e4a01d8db..f6f23400a 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -5,7 +5,7 @@ In this guide we cover how you can migrate from a from source installation to one using OTP releases. ## Pre-requisites -You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`. +You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`. The system needs to have `curl` and `unzip` installed for downloading and unpacking release builds. diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index 0861a8157..8c02201e6 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -8,7 +8,7 @@ This guide covers a installation using an OTP release. To install Pleroma from s * A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPU, you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below * A (sub)domain pointed to the machine -You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`. +You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`. While in theory OTP releases are possbile to install on any compatible machine, for the sake of simplicity this guide focuses only on Debian/Ubuntu and Alpine. diff --git a/lib/pleroma/web/plugs/ensure_privileged_plug.ex b/lib/pleroma/web/plugs/ensure_privileged_plug.ex index be09f3d81..f886c87ea 100644 --- a/lib/pleroma/web/plugs/ensure_privileged_plug.ex +++ b/lib/pleroma/web/plugs/ensure_privileged_plug.ex @@ -24,10 +24,10 @@ defmodule Pleroma.Web.Plugs.EnsurePrivilegedPlug do def call( %{assigns: %{user: %User{is_admin: is_admin, is_moderator: is_moderator}}} = conn, - priviledge + privilege ) do - if (is_admin and priviledge in Config.get([:instance, :admin_privileges])) or - (is_moderator and priviledge in Config.get([:instance, :moderator_privileges])) do + if (is_admin and privilege in Config.get([:instance, :admin_privileges])) or + (is_moderator and privilege in Config.get([:instance, :moderator_privileges])) do conn else conn diff --git a/test/pleroma/web/plugs/ensure_privileged_plug_test.exs b/test/pleroma/web/plugs/ensure_privileged_plug_test.exs index 423413946..4b6679b66 100644 --- a/test/pleroma/web/plugs/ensure_privileged_plug_test.exs +++ b/test/pleroma/web/plugs/ensure_privileged_plug_test.exs @@ -64,7 +64,7 @@ defmodule Pleroma.Web.Plugs.EnsurePrivilegedPlugTest do assert conn.status == 403 end - test "accepts for a priviledged role even if other role isn't priviledged" do + test "accepts for a privileged role even if other role isn't privileged" do clear_config([:instance, :admin_privileges], [:cofe]) clear_config([:instance, :moderator_privileges], []) user = insert(:user, is_admin: true, is_moderator: true) @@ -72,7 +72,7 @@ defmodule Pleroma.Web.Plugs.EnsurePrivilegedPlugTest do ret_conn = EnsurePrivilegedPlug.call(conn, :cofe) - # priviledged through admin role + # privileged through admin role assert conn == ret_conn clear_config([:instance, :admin_privileges], []) @@ -82,7 +82,7 @@ defmodule Pleroma.Web.Plugs.EnsurePrivilegedPlugTest do ret_conn = EnsurePrivilegedPlug.call(conn, :cofe) - # priviledged through moderator role + # privileged through moderator role assert conn == ret_conn end