95781[FEATURE] Introduce security voters for authorization
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Benni Mack +1
- core-ci +1 CI
Issues 4
Files 53
- typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php+17 −4
- typo3/sysext/backend/Classes/Module/AccessGate/AdminGate.php+3 −0
- typo3/sysext/backend/Classes/Module/AccessGate/SystemMaintainerGate.php+3 −0
- typo3/sysext/backend/Classes/Module/AccessGate/UserGate.php+3 −0
- typo3/sysext/backend/Classes/Module/ModuleAccessGateInterface.php+7 −0
- typo3/sysext/backend/Classes/Module/ModuleAccessGateRegistry.php+2 −0
- typo3/sysext/backend/Classes/Module/ModuleAccessResult.php+2 −0
- typo3/sysext/backend/Classes/Module/ModuleProvider.php+20 −29
- typo3/sysext/backend/Classes/Security/Authorization/ModuleAccessGateVoter.phpnew+96 −0
- typo3/sysext/backend/Classes/Security/Authorization/ModuleVoter.phpnew+121 −0
- typo3/sysext/backend/Classes/Security/Authorization/ModuleWorkspaceVoter.phpnew+113 −0
- typo3/sysext/backend/Classes/Security/Authorization/ReplacedModuleAccessGates.phpnew+52 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_module_access_gate_override/Classes/RestrictedAdminGate.phpnew+40 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_module_access_gate_override/Configuration/Services.yamlnew+8 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_module_access_gate_override/composer.jsonnew+23 −0
- typo3/sysext/backend/Tests/Functional/Middleware/BackendUserAuthenticatorTest.php+35 −0
- typo3/sysext/backend/Tests/Functional/Module/ModuleAccessGateOverrideTest.phpnew+76 −0
- typo3/sysext/backend/Tests/Functional/Module/ModuleProviderTest.php+318 −24
- typo3/sysext/backend/Tests/Functional/Security/Authorization/Fixtures/ModuleAccess.csvnew+11 −0
- typo3/sysext/backend/Tests/Functional/Security/Authorization/ModuleVoterTest.phpnew+123 −0
Show 33 more files
- typo3/sysext/core/Classes/Attribute/AsModuleAccessGate.php+2 −0
- typo3/sysext/core/Classes/Attribute/AsSecurityVoter.phpnew+36 −0
- typo3/sysext/core/Classes/Authentication/Pipeline/LegacyUserPrincipalFactory.php+62 −21
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+1 −1
- typo3/sysext/core/Classes/Authentication/Principal.php+8 −2
- typo3/sysext/core/Classes/Security/Authorization/Policy/Scope.phpnew+31 −0
- typo3/sysext/core/Classes/Security/Authorization/Voter/PrincipalVoter.phpnew+65 −0
- typo3/sysext/core/Classes/Security/Authorization/LegacyBackendUserRegistry.phpnew+82 −0
- typo3/sysext/core/Classes/Security/Authorization/PrincipalToken.phpnew+57 −0
- typo3/sysext/core/Classes/Security/Authorization/PrincipalUser.phpnew+78 −0
- typo3/sysext/core/Classes/Security/Authorization/SecurityRole.phpnew+84 −0
- typo3/sysext/core/Classes/Security/PermissionSet/PrincipalContext.php+5 −2
- typo3/sysext/core/Classes/Security/PermissionSet/PrincipalRole.php+1 −1
- typo3/sysext/core/Configuration/Services.php+15 −0
- typo3/sysext/core/Configuration/Services.yaml+36 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Deprecation-111236-ModuleAccessGates.rstnew+90 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111236-SecurityVotersForAuthorizationDecisions.rstnew+220 −0
- typo3/sysext/core/Tests/Functional/Authentication/Pipeline/LegacyUserPrincipalFactoryTest.php+23 −4
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Classes/Module/ProjectManagerGate.phpnew+42 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Classes/Voter/FrozenRecordVoter.phpnew+40 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Classes/Voter/ProjectLeadModuleVoter.phpnew+47 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Classes/Voter/RecordVoter.phpnew+45 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Classes/Voter/RestrictedModuleVoter.phpnew+48 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/Configuration/Services.yamlnew+8 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_security_voter/composer.jsonnew+23 −0
- typo3/sysext/core/Tests/Functional/Security/Authorization/AuthorizationCheckerTest.phpnew+149 −0
- typo3/sysext/core/Tests/Unit/Security/Authorization/PrincipalTokenTest.phpnew+105 −0
- typo3/sysext/core/composer.json+1 −0
- typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php+18 −4
- typo3/sysext/frontend/Tests/Functional/Middleware/FrontendUserAuthenticatorTest.php+25 −0
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php+35 −0
- composer.json+3 −0
- composer.lock+157 −1
Review log 2745
Show 1220 earlier messages
-
Thomas Maroschik uploaded patch set 1 09/12/26, 08:29
-
core-ci voted on patch set 1 V +1 09/12/26, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108387
-
Thomas Maroschik updated the commit message in patch set 2
V +109/12/26, 09:04 -
core-ci voted on patch set 2 V +1 09/12/26, 09:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108394
-
Thomas Maroschik abandoned the change 10/22/26, 16:15
-
Thomas Maroschik commented on patch set 2 10/22/26, 16:16
Abandoned after talking with Benni, that a typo3 native auth is favored because of PSR/symfony request bridge problems. -
Benni Mack restored the change 10/25/26, 14:19
-
Benni Mack uploaded patch set 3
V +110/25/26, 14:19 -
core-ci voted on patch set 3 V +1 10/25/26, 14:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112511
-
Oli Bartsch rebased onto patch set 4
V +110/25/26, 19:39 -
core-ci voted on patch set 4 V +1 10/25/26, 20:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112541
-
Benni Mack rebased onto patch set 5
V +110/26/26, 19:41 -
core-ci voted on patch set 5 V +1 10/26/26, 20:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112608
-
Benni Mack rebased onto patch set 6
V +111/03/26, 14:43 -
core-ci voted on patch set 6 V +1 11/03/26, 15:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113164
-
Benni Mack uploaded patch set 7
V +111/09/26, 10:12 -
core-ci voted on patch set 7 V +1 11/09/26, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113640
-
Benni Mack uploaded patch set 8
V +111/10/26, 20:26 -
core-ci voted on patch set 8 V +1 11/10/26, 20:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113947
-
Benni Mack marked it ready for review 11/10/26, 22:10
-
Benni Mack rebased onto patch set 9
V +111/13/26, 14:31 -
core-ci voted on patch set 9 V +1 11/13/26, 16:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114339
-
Benni Mack rebased onto patch set 10
V +111/13/26, 19:02 -
core-ci voted on patch set 10 V +1 11/13/26, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114375
-
Benni Mack rebased onto patch set 11
V +111/13/26, 20:59 -
core-ci voted on patch set 11 V +1 11/13/26, 22:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114397
-
Benni Mack uploaded patch set 12
V +111/17/26, 15:48 -
core-ci voted on patch set 12 V +1 11/17/26, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114756
-
Oli Bartsch uploaded patch set 13
V +111/17/26, 17:23 -
core-ci voted on patch set 13 V +1 11/17/26, 17:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114768
-
Oli Bartsch uploaded patch set 14
V +111/17/26, 17:58 -
core-ci voted on patch set 14 V +1 11/17/26, 18:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114773
-
Benni Mack uploaded patch set 15
V +111/17/26, 18:50 -
core-ci voted on patch set 15 V -1 11/17/26, 19:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114779
-
Benni Mack uploaded patch set 16
V -111/18/26, 08:04 -
core-ci voted on patch set 16 V -1 11/18/26, 08:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114827
-
Benni Mack uploaded patch set 17
V -111/18/26, 10:35 -
core-ci voted on patch set 17 V +1 11/18/26, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114846
-
Oli Bartsch uploaded patch set 18
V +111/18/26, 15:22 -
Oli Bartsch commented on patch set 18 11/18/26, 15:23
The read part of Principal is now public API. The context's role, id and groupIds, and isBackendUser(). Creating a Principal stays internal, so the voteOnPrincipal() signature and the RST examples can stay as they are. The module workspace restriction is now decided by a new ModuleWorkspaceVoter, so isGranted(Scope::ACCESS, $module) and ModuleProvider::accessGranted() give the same answer. ModuleProvider now asks the access decision manager with a PrincipalToken, so its constructor takes AccessDecisionManagerInterface. Callers can still skip the workspace check with $respectWorkspaceRestrictions = false. ModuleVoter now denies frontend principals, the RST example is renamed to canAccessLayoutModule(). Still open: A public way to get a PrincipalUser for a backend user object. -
core-ci voted on patch set 18 V +1 11/18/26, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114883
-
Benni Mack voted on patch set 18 CR +1 V +1 11/18/26, 17:33
-
Oli Bartsch voted on patch set 18 CR +1 V +1 11/18/26, 17:37
-
Oli Bartsch voted on patch set 18 CR +2 V +2 11/18/26, 18:51
-
Oli Bartsch merged patch set 19 11/18/26, 18:51