Browse Source

Fix functional user requirements in whitelist mode (#14093)

Fixes #14092
feature_cybrespace_locale
ThibG 3 years ago committed by GitHub
parent
commit
ac8a788370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/controllers/accounts_controller.rb
  2. 2
      app/controllers/api/base_controller.rb
  3. 2
      app/controllers/directories_controller.rb
  4. 2
      app/controllers/follower_accounts_controller.rb
  5. 2
      app/controllers/following_accounts_controller.rb
  6. 2
      app/controllers/media_controller.rb
  7. 2
      app/controllers/remote_interaction_controller.rb
  8. 2
      app/controllers/statuses_controller.rb
  9. 2
      app/controllers/tags_controller.rb

2
app/controllers/accounts_controller.rb

@ -11,7 +11,7 @@ class AccountsController < ApplicationController @@ -11,7 +11,7 @@ class AccountsController < ApplicationController
before_action :set_body_classes
skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format&.to_sym) }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def show
respond_to do |format|

2
app/controllers/api/base_controller.rb

@ -7,7 +7,7 @@ class Api::BaseController < ApplicationController @@ -7,7 +7,7 @@ class Api::BaseController < ApplicationController
include RateLimitHeaders
skip_before_action :store_current_location
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
before_action :require_authenticated_user!, if: :disallow_unauthenticated_api_access?
before_action :set_cache_headers

2
app/controllers/directories_controller.rb

@ -9,7 +9,7 @@ class DirectoriesController < ApplicationController @@ -9,7 +9,7 @@ class DirectoriesController < ApplicationController
before_action :set_tag, only: :show
before_action :set_accounts
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def index
render :index

2
app/controllers/follower_accounts_controller.rb

@ -8,7 +8,7 @@ class FollowerAccountsController < ApplicationController @@ -8,7 +8,7 @@ class FollowerAccountsController < ApplicationController
before_action :set_cache_headers
skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def index
respond_to do |format|

2
app/controllers/following_accounts_controller.rb

@ -8,7 +8,7 @@ class FollowingAccountsController < ApplicationController @@ -8,7 +8,7 @@ class FollowingAccountsController < ApplicationController
before_action :set_cache_headers
skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def index
respond_to do |format|

2
app/controllers/media_controller.rb

@ -4,7 +4,7 @@ class MediaController < ApplicationController @@ -4,7 +4,7 @@ class MediaController < ApplicationController
include Authorization
skip_before_action :store_current_location
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
before_action :authenticate_user!, if: :whitelist_mode?
before_action :set_media_attachment

2
app/controllers/remote_interaction_controller.rb

@ -10,7 +10,7 @@ class RemoteInteractionController < ApplicationController @@ -10,7 +10,7 @@ class RemoteInteractionController < ApplicationController
before_action :set_status
before_action :set_body_classes
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def new
@remote_follow = RemoteFollow.new(session_params)

2
app/controllers/statuses_controller.rb

@ -19,7 +19,7 @@ class StatusesController < ApplicationController @@ -19,7 +19,7 @@ class StatusesController < ApplicationController
before_action :set_autoplay, only: :embed
skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!, only: [:show, :embed]
skip_before_action :require_functional!, only: [:show, :embed], unless: :whitelist_mode?
content_security_policy only: :embed do |p|
p.frame_ancestors(false)

2
app/controllers/tags_controller.rb

@ -15,7 +15,7 @@ class TagsController < ApplicationController @@ -15,7 +15,7 @@ class TagsController < ApplicationController
before_action :set_body_classes
before_action :set_instance_presenter
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?
def show
respond_to do |format|

Loading…
Cancel
Save