From: Claire Date: Fri, 27 May 2022 14:21:59 +0000 (+0200) Subject: Fix incorrect permission check for notifications destroy/dismiss endpoints (#1787) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=a890d88dd271bd9feda11306af9d9a1ac3d7a09a;p=mastodon.git Fix incorrect permission check for notifications destroy/dismiss endpoints (#1787) --- diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index c47d6ccfd..ac49167cb 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true class Api::V1::NotificationsController < Api::BaseController - before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :dismiss] - before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :dismiss] + before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :dismiss, :destroy, :destroy_multiple] + before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :dismiss, :destroy, :destroy_multiple] before_action :require_user! after_action :insert_pagination_headers, only: :index