mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
Refactor admin base controller (#18453)
* DEV: Add a dedicated Admin::StaffController base controller The current parent(Admin:AdminController) for all admin-related controllers uses a filter that allows only staff(admin, moderator) users. This refactor makes Admin::AdminController filter for only admins as the name suggests and introduces a base controller dedicated for staff-related endpoints. * DEV: Set staff-only controllers parent to Admin::StaffController Refactor staff-only controllers to inherit newly introduced Admin::StaffController abstract controller. This conveys the purpose of the parent controller better unlike the previously used parent controller.
This commit is contained in:
6
app/controllers/admin/staff_controller.rb
Normal file
6
app/controllers/admin/staff_controller.rb
Normal file
@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::StaffController < ApplicationController
|
||||
requires_login
|
||||
before_action :ensure_staff
|
||||
end
|
Reference in New Issue
Block a user