aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-09-18 12:31:33 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-09-18 12:31:33 +0300
commit551f2fa59eec11c94eb0ab187c06ccab7b8d5647 (patch)
tree9942b080a8d4b76b10229b55cb74be2087aeb2da
parentb17f217bf3a16da0e98e63b59da22f40beec809d (diff)
downloadpleroma-551f2fa59eec11c94eb0ab187c06ccab7b8d5647.tar.gz
[#1234] Added changelog entry, removed admin OAuth scopes.
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/pleroma/web/admin_api/admin_api_controller.ex16
2 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 584386136..7e2c8066f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -117,6 +117,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Admin API: Added moderation log
- Web response cache (currently, enabled for ActivityPub)
- Mastodon API: Added an endpoint to get multiple statuses by IDs (`GET /api/v1/statuses/?ids[]=1&ids[]=2`)
+- OAuth: support for hierarchical permissions / [Mastodon 2.4.3 OAuth permissions](https://docs.joinmastodon.org/api/permissions/)
### Changed
- Configuration: Filter.AnonymizeFilename added ability to retain file extension with custom text
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
index 2c9840580..7f1a8e566 100644
--- a/lib/pleroma/web/admin_api/admin_api_controller.ex
+++ b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -26,13 +26,13 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
plug(
OAuthScopesPlug,
- %{scopes: ["admin:read:accounts", "read:accounts"]}
+ %{scopes: ["read:accounts"]}
when action in [:list_users, :user_show, :right_get, :invites]
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:write", "write:accounts"]}
+ %{scopes: ["write:accounts"]}
when action in [
:get_invite_token,
:revoke_invite,
@@ -53,35 +53,35 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
plug(
OAuthScopesPlug,
- %{scopes: ["admin:read:reports", "read:reports"]} when action in [:list_reports, :report_show]
+ %{scopes: ["read:reports"]} when action in [:list_reports, :report_show]
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:write:reports", "write:reports"]}
+ %{scopes: ["write:reports"]}
when action in [:report_update_state, :report_respond]
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:read:statuses", "read:statuses"]} when action == :list_user_statuses
+ %{scopes: ["read:statuses"]} when action == :list_user_statuses
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:write:statuses", "write:statuses"]}
+ %{scopes: ["write:statuses"]}
when action in [:status_update, :status_delete]
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:read", "read"]}
+ %{scopes: ["read"]}
when action in [:config_show, :migrate_to_db, :migrate_from_db, :list_log]
)
plug(
OAuthScopesPlug,
- %{scopes: ["admin:write", "write"]}
+ %{scopes: ["write"]}
when action in [:relay_follow, :relay_unfollow, :config_update]
)