mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 11:02:18 +08:00
DEV: Move discourse-chat
to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
This commit is contained in:
13
plugins/chat/app/controllers/api_controller.rb
Normal file
13
plugins/chat/app/controllers/api_controller.rb
Normal file
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Chat::Api < Chat::ChatBaseController
|
||||
before_action :ensure_logged_in
|
||||
before_action :ensure_can_chat
|
||||
|
||||
private
|
||||
|
||||
def ensure_can_chat
|
||||
raise Discourse::NotFound unless SiteSetting.chat_enabled
|
||||
guardian.ensure_can_chat!(current_user)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user