TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\Security\PermissionSet;
|
||||
|
||||
/**
|
||||
* Represents the identity and group membership of a principal for authorization.
|
||||
*
|
||||
* Contains the core identity information needed for permission evaluation,
|
||||
* including the role level, unique identifier, group memberships, and
|
||||
* impersonation context. This is used as part of the Principal object
|
||||
* to provide context for permission checks.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final readonly class PrincipalContext
|
||||
{
|
||||
/**
|
||||
* @param PrincipalRole $role The role level of the principal
|
||||
* @param int $id The unique identifier of the principal (user ID, system ID)
|
||||
* @param array<int> $groupIds List of group IDs the principal belongs to
|
||||
* @param self|null $impersonatedBy Optional parent context when impersonation is active
|
||||
*/
|
||||
public function __construct(
|
||||
public PrincipalRole $role,
|
||||
public int $id,
|
||||
public array $groupIds = [],
|
||||
public ?self $impersonatedBy = null,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\Security\PermissionSet;
|
||||
|
||||
/**
|
||||
* Principal roles for determining privilege levels.
|
||||
*
|
||||
* Defines the role-based access control levels:
|
||||
* - SYSTEM: System-level operations (CLI, install tool internal)
|
||||
* - MAINTAINER: Install tool users, system maintenance tasks
|
||||
* - ADMIN: Backend administrators (bypasses permission checks)
|
||||
* - USER: Regular backend users (respects permission grants)
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
enum PrincipalRole: string
|
||||
{
|
||||
case SYSTEM = 'system';
|
||||
case MAINTAINER = 'maintainer';
|
||||
case ADMIN = 'admin';
|
||||
case USER = 'user';
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\Security\PermissionSet;
|
||||
|
||||
/**
|
||||
* Provides workspace and user-specific configuration during data processing operations.
|
||||
*
|
||||
* Contains context information needed for permission evaluation and data manipulation,
|
||||
* primarily used by DataHandler and related components. Includes the current workspace
|
||||
* ID for versioning support and user-specific configuration (TSconfig, preferences)
|
||||
* that may affect permission checks and data handling behavior.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class ProcessingContext
|
||||
{
|
||||
/**
|
||||
* @param int $workspaceId The workspace ID for the current operation (mutable for DataHandler compatibility)
|
||||
* @param array<string, mixed> $userTsConfig User TSconfig configuration array
|
||||
* @param array<string, mixed> $userPreferences User preferences array
|
||||
*/
|
||||
public function __construct(
|
||||
// @todo still required writable due to `DataHandler`
|
||||
public int $workspaceId = 0,
|
||||
public readonly array $userTsConfig = [],
|
||||
public readonly array $userPreferences = [],
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user