定制 liquidlight/typo3-elevate-to-admin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

liquidlight/typo3-elevate-to-admin

Composer 安装命令:

composer require liquidlight/typo3-elevate-to-admin

包简介

Allow users to elevate themselves to admin if they have permission to do so

README 文档

README

A TYPO3 extension that removes permanent admin access and lets users elevate to admin only when needed.

Admin users log in without admin privileges. Not only does this satisfy cyber security accreditations*, it allows your admin users to use the website as Editors which means they can quickly see any permissions or UI Bugs, issues and errors

Features

  • Meets Cyber Essentials and ISO 27001 requirements*
  • See who is an admin and since when
  • Resets privileges after 10 minutes of inactivity
  • Clears admin privileges after logging out
  • Allows admins to sill log in when backend is locked for editors

Installation

  1. composer require liquidlight/typo3-elevate-to-admin
  2. Edit backend users and enable "Can elevate to admin" where appropriate (existing admins will have this enabled when they login )
  3. Selected users can use the dropdown in the corner to elevate to admin

Screenshot of dropdown

The user can exit admin mode by using the same dropdown.

How It Works

  1. Login as regular user - Admin users log in without admin privileges
  2. Work normally - Browse, edit content, and perform regular tasks
  3. Elevate when needed - Click the dropdown to become admin for specific tasks
  4. Auto-logout - Admin privileges automatically expire after 10 minutes of inactivity

Events

The extension dispatches PSR-14 events that allow you to customize the behaviour:

BeforeAdminElevationProcessEvent

This event is dispatched before the admin elevation processing begins. You can use it to skip the elevation process entirely based on custom conditions.

Example: Make everyone admin in development mode

<?php

namespace MyVendor\MyExtension\EventListener;

use LiquidLight\ElevateToAdmin\Event\BeforeAdminElevationProcessEvent;
use LiquidLight\ElevateToAdmin\Traits\AdminElevationTrait;
use TYPO3\CMS\Core\Core\Environment;

final class DevModeAdminListener
{
    use AdminElevationTrait;

    public function __invoke(BeforeAdminElevationProcessEvent $event): void
    {
        if (Environment::getContext()->isDevelopment()) {
            $user = $event->getBackendUser();

            // Make user admin if they can elevate and aren't already admin
            if ($this->canUserElevate($user) && !$user->isAdmin()) {
                $this->setAdminElevation((int)$user->user['uid']);
            }

            // Skip normal processing since we've handled it
            $event->skipProcessing();
        }
    }
}

Register the event listener in Configuration/Services.yaml:

services:
  MyVendor\MyExtension\EventListener\DevModeAdminListener:
    tags:
      - name: event.listener
        identifier: 'dev-mode-admin'
        event: LiquidLight\ElevateToAdmin\Event\BeforeAdminElevationProcessEvent

Testing

This extension includes comprehensive unit and functional tests with database integration.

Unit Tests

Unit tests can be run with

composer i
composer test-unit

Functional Tests

Unit tests can be run with

composer i
composer test-functional

* Cybersecurity requirements

Please check to ensure elevation/re-authentication is acceptable for your require security practices and accreditations. After our research, we have found:

Cyber Essentials

The official requirement states "use separate accounts to perform administrative activities only" - but this is ambiguous. It could mean:

  • Separate user accounts (strict interpretation)
  • Separate administrative sessions/activities (flexible interpretation allowing elevation)

Problem: Some certification bodies explicitly state that "account separation" is mandatory and that privilege elevation methods don't meet requirements, while others may accept properly implemented elevation.

Recommendation: Check with your specific certification body, as interpretations vary.

ISO 27001:2022

More flexible approach. The updated standard "does not explicitly require a different user ID for privileged access" and "emphasises the need to re-authenticate prior to receiving privileged access rights."

Elevation with re-authentication is acceptable if it includes:

  • Proper re-authentication before privilege escalation
  • Session separation and logging
  • Clear audit trails

Bottom Line

  • Cyber Essentials: Unclear - depends on your certification body's interpretation
  • ISO 27001:2022: Elevation with proper controls is acceptable

Sources

Always verify requirements with your certification body before implementation

liquidlight/typo3-elevate-to-admin 适用场景与选型建议

liquidlight/typo3-elevate-to-admin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 liquidlight/typo3-elevate-to-admin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 liquidlight/typo3-elevate-to-admin 我们能提供哪些服务?
定制开发 / 二次开发

基于 liquidlight/typo3-elevate-to-admin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2025-09-12