Bicycle/App/Controller/Admin/AdminController.php
Egor Isaev bbeb36b2e8 dev
2026-08-06 16:52:19 +03:00

28 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @package Bicycle
* @author Egor Isaev
* @description AdminController.php
* @copyright (c) 24/06/2026
*/
namespace App\Controller\Admin;
use System\Classes\Controller;
/**
* Базовый контроллер админки. Рендерится в общем layout сайта
* (App/view/layout.html), своего отдельного шаблона не имеет.
* Требует авторизацию с ролью admin (см. Controller::$_auth_protection/$_auth_roles) —
* неавторизованный редиректится на /login, авторизованный без роли admin получает 403.
* Конкретные страницы (Logs и т.п.) наследуют его.
*/
abstract class AdminController extends Controller
{
/** @var bool Доступ в админку только авторизованным пользователям */
protected bool $_auth_protection = true;
/** @var array<int,string> В админку пускаем только роль admin */
protected array $_auth_roles = ['admin'];
}