def authorize_admin_access
      Setting.reload_settings
      if !check_controller_against_user(params[:controller].sub('roroacms/admin/', '')) && params[:controller] != 'roroacms/admin/dashboard' && params[:controller].include?('roroacms')
        redirect_to admin_path, flash: { error: I18n.t("controllers.admin.misc.authorize_admin_access_error") }
      end
    end
def authorize_admin_access
      Setting.reload_settings
      if !check_controller_against_user(params[:controller].sub('roroacms/admin/', '')) && params[:controller] != 'roroacms/admin/dashboard' && params[:controller].include?('roroacms')
        redirect_to admin_path, flash: { error: I18n.t("controllers.admin.misc.authorize_admin_access_error") }
      end
    end
checks to see if the admin logged in has the necesary rights, if not it will redirect them with an error message