Add post status administration (#105)

This commit is contained in:
Riccardo Graziosi
2022-05-01 18:00:38 +02:00
committed by GitHub
parent c5148147e3
commit 5256ea911a
47 changed files with 1580 additions and 32 deletions

View File

@@ -6,22 +6,10 @@
# you're free to overwrite the RESTful controller actions.
module Admin
class ApplicationController < Administrate::ApplicationController
include ApplicationHelper
before_action :authenticate_admin
def authenticate_admin
unless user_signed_in?
flash[:alert] = 'You must be logged in to access this page.'
redirect_to new_user_session_path
return
end
unless current_user.moderator? || current_user.admin?
flash[:alert] = 'You do not have the privilegies to access this page.'
redirect_to root_path
return
end
end
# Override this value to specify the number of elements to display at a time
# on index pages. Defaults to 20.
# def records_per_page