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:
Selase Krakani
2022-10-31 12:02:26 +00:00
committed by GitHub
parent 5e4bad0d8f
commit 586454bcf1
30 changed files with 190 additions and 60 deletions

View File

@ -2,8 +2,8 @@
RSpec.describe Admin::PluginsController do
it "is a subclass of AdminController" do
expect(Admin::PluginsController < Admin::AdminController).to eq(true)
it "is a subclass of StaffController" do
expect(Admin::PluginsController < Admin::StaffController).to eq(true)
end
context "while logged in as an admin" do