‪TYPO3CMS  10.4
BackendUserAuthenticationTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\MockObject\MockObject;
21 use Prophecy\Argument;
22 use Prophecy\Prophecy\ObjectProphecy;
23 use Psr\Log\NullLogger;
35 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
36 
40 class ‪BackendUserAuthenticationTest extends UnitTestCase
41 {
45  protected ‪$defaultFilePermissions = [
46  // File permissions
47  'addFile' => false,
48  'readFile' => false,
49  'writeFile' => false,
50  'copyFile' => false,
51  'moveFile' => false,
52  'renameFile' => false,
53  'deleteFile' => false,
54  // Folder permissions
55  'addFolder' => false,
56  'readFolder' => false,
57  'writeFolder' => false,
58  'copyFolder' => false,
59  'moveFolder' => false,
60  'renameFolder' => false,
61  'deleteFolder' => false,
62  'recursivedeleteFolder' => false
63  ];
64 
65  protected function ‪setUp(): void
66  {
67  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] = 4;
68  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['lockIPv6'] = 8;
69  }
70 
74  protected function ‪tearDown(): void
75  {
77  parent::tearDown();
78  }
79 
81  // Tests concerning the form protection
83 
87  {
89  $connection = $this->prophesize(Connection::class);
90  $connection->delete('sys_lockedrecords', Argument::cetera())->willReturn(1);
91 
93  $connectionPool = $this->prophesize(ConnectionPool::class);
94  $connectionPool->getConnectionForTable(Argument::cetera())->willReturn($connection->reveal());
95 
96  GeneralUtility::addInstance(ConnectionPool::class, $connectionPool->reveal());
97 
99  $formProtection = $this->prophesize(BackendFormProtection::class);
100  $formProtection->clean()->shouldBeCalled();
101 
103  'default',
104  $formProtection->reveal()
105  );
106 
107  ‪$GLOBALS['BE_USER'] = $this->getMockBuilder(BackendUserAuthentication::class)->getMock();
108  ‪$GLOBALS['BE_USER']->user = [
109  'uid' => 4711,
110  'ses_backuserid' => 0,
111  ];
112  ‪$GLOBALS['BE_USER']->setLogger(new NullLogger());
113 
115  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
116  ->setMethods(['dummy'])
117  ->disableOriginalConstructor()
118  ->getMock();
119 
120  $subject->setLogger(new NullLogger());
121  $subject->logoff();
122  }
123 
128  {
129  return [
130  'Only read permissions' => [
131  [
132  'addFile' => 0,
133  'readFile' => 1,
134  'writeFile' => 0,
135  'copyFile' => 0,
136  'moveFile' => 0,
137  'renameFile' => 0,
138  'deleteFile' => 0,
139  'addFolder' => 0,
140  'readFolder' => 1,
141  'copyFolder' => 0,
142  'moveFolder' => 0,
143  'renameFolder' => 0,
144  'writeFolder' => 0,
145  'deleteFolder' => 0,
146  'recursivedeleteFolder' => 0,
147  ]
148  ],
149  'Uploading allowed' => [
150  [
151  'addFile' => 1,
152  'readFile' => 1,
153  'writeFile' => 1,
154  'copyFile' => 1,
155  'moveFile' => 1,
156  'renameFile' => 1,
157  'deleteFile' => 1,
158  'addFolder' => 0,
159  'readFolder' => 1,
160  'copyFolder' => 0,
161  'moveFolder' => 0,
162  'renameFolder' => 0,
163  'writeFolder' => 0,
164  'deleteFolder' => 0,
165  'recursivedeleteFolder' => 0
166  ]
167  ],
168  'One value is enough' => [
169  [
170  'addFile' => 1,
171  ]
172  ],
173  ];
174  }
175 
182  {
184  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
185  ->setMethods(['isAdmin', 'getTSConfig'])
186  ->getMock();
187 
188  $subject
189  ->expects(self::any())
190  ->method('isAdmin')
191  ->willReturn(false);
192 
193  $subject->setLogger(new NullLogger());
194  $subject
195  ->expects(self::any())
196  ->method('getTSConfig')
197  ->willReturn([
198  'permissions.' => [
199  'file.' => [
200  'default.' => $userTsConfiguration
201  ],
202  ]
203  ]);
204 
205  $expectedPermissions = array_merge($this->defaultFilePermissions, $userTsConfiguration);
206  array_walk(
207  $expectedPermissions,
208  function (&$value) {
209  $value = (bool)$value;
210  }
211  );
212 
213  self::assertEquals($expectedPermissions, $subject->getFilePermissions());
214  }
215 
219  public function ‪getFilePermissionsFromStorageDataProvider(): array
220  {
221  $defaultPermissions = [
222  'addFile' => true,
223  'readFile' => true,
224  'writeFile' => true,
225  'copyFile' => true,
226  'moveFile' => true,
227  'renameFile' => true,
228  'deleteFile' => true,
229  'addFolder' => true,
230  'readFolder' => true,
231  'copyFolder' => true,
232  'moveFolder' => true,
233  'renameFolder' => true,
234  'writeFolder' => true,
235  'deleteFolder' => true,
236  'recursivedeleteFolder' => true
237  ];
238 
239  return [
240  'Overwrites given storage permissions with default permissions' => [
241  $defaultPermissions,
242  1,
243  [
244  'addFile' => 0,
245  'recursivedeleteFolder' =>0
246  ],
247  [
248  'addFile' => 0,
249  'readFile' => 1,
250  'writeFile' => 1,
251  'copyFile' => 1,
252  'moveFile' => 1,
253  'renameFile' => 1,
254  'deleteFile' => 1,
255  'addFolder' => 1,
256  'readFolder' => 1,
257  'copyFolder' => 1,
258  'moveFolder' => 1,
259  'renameFolder' => 1,
260  'writeFolder' => 1,
261  'deleteFolder' => 1,
262  'recursivedeleteFolder' => 0
263  ]
264  ],
265  'Overwrites given storage 0 permissions with default permissions' => [
266  $defaultPermissions,
267  0,
268  [
269  'addFile' => 0,
270  'recursivedeleteFolder' =>0
271  ],
272  [
273  'addFile' => false,
274  'readFile' => true,
275  'writeFile' => true,
276  'copyFile' => true,
277  'moveFile' => true,
278  'renameFile' => true,
279  'deleteFile' => true,
280  'addFolder' => true,
281  'readFolder' => true,
282  'copyFolder' => true,
283  'moveFolder' => true,
284  'renameFolder' => true,
285  'writeFolder' => true,
286  'deleteFolder' => true,
287  'recursivedeleteFolder' => false
288  ]
289  ],
290  'Returns default permissions if no storage permissions are found' => [
291  $defaultPermissions,
292  1,
293  [],
294  [
295  'addFile' => true,
296  'readFile' => true,
297  'writeFile' => true,
298  'copyFile' => true,
299  'moveFile' => true,
300  'renameFile' => true,
301  'deleteFile' => true,
302  'addFolder' => true,
303  'readFolder' => true,
304  'copyFolder' => true,
305  'moveFolder' => true,
306  'renameFolder' => true,
307  'writeFolder' => true,
308  'deleteFolder' => true,
309  'recursivedeleteFolder' => true
310  ]
311  ],
312  ];
313  }
314 
323  public function ‪getFilePermissionsFromStorageOverwritesDefaultPermissions(array $defaultPermissions, $storageUid, array $storagePermissions, array $expectedPermissions): void
324  {
326  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
327  ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
328  ->getMock();
329  $storageMock = $this->createMock(ResourceStorage::class);
330  $storageMock->expects(self::any())->method('getUid')->willReturn($storageUid);
331 
332  $subject
333  ->expects(self::any())
334  ->method('isAdmin')
335  ->willReturn(false);
336 
337  $subject
338  ->expects(self::any())
339  ->method('getFilePermissions')
340  ->willReturn($defaultPermissions);
341 
342  $subject
343  ->expects(self::any())
344  ->method('getTSConfig')
345  ->willReturn([
346  'permissions.' => [
347  'file.' => [
348  'storage.' => [
349  $storageUid . '.' => $storagePermissions
350  ],
351  ],
352  ]
353  ]);
354 
355  self::assertEquals($expectedPermissions, $subject->getFilePermissionsForStorage($storageMock));
356  }
357 
365  public function ‪getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins(array $defaultPermissions, $storageUid, array $storagePermissions): void
366  {
368  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
369  ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
370  ->getMock();
371  $storageMock = $this->createMock(ResourceStorage::class);
372  $storageMock->expects(self::any())->method('getUid')->willReturn($storageUid);
373 
374  $subject
375  ->expects(self::any())
376  ->method('isAdmin')
377  ->willReturn(true);
378 
379  $subject
380  ->expects(self::any())
381  ->method('getFilePermissions')
382  ->willReturn($defaultPermissions);
383 
384  $subject
385  ->expects(self::any())
386  ->method('getTSConfig')
387  ->willReturn([
388  'permissions.' => [
389  'file.' => [
390  'storage.' => [
391  $storageUid . '.' => $storagePermissions
392  ],
393  ],
394  ]
395  ]);
396 
397  self::assertEquals($defaultPermissions, $subject->getFilePermissionsForStorage($storageMock));
398  }
399 
404  {
405  return [
406  'No permission' => [
407  '',
408  [
409  'addFile' => false,
410  'readFile' => false,
411  'writeFile' => false,
412  'copyFile' => false,
413  'moveFile' => false,
414  'renameFile' => false,
415  'deleteFile' => false,
416  'addFolder' => false,
417  'readFolder' => false,
418  'copyFolder' => false,
419  'moveFolder' => false,
420  'renameFolder' => false,
421  'writeFolder' => false,
422  'deleteFolder' => false,
423  'recursivedeleteFolder' => false
424  ]
425  ],
426  'Standard file permissions' => [
427  'addFile,readFile,writeFile,copyFile,moveFile,renameFile,deleteFile',
428  [
429  'addFile' => true,
430  'readFile' => true,
431  'writeFile' => true,
432  'copyFile' => true,
433  'moveFile' => true,
434  'renameFile' => true,
435  'deleteFile' => true,
436  'addFolder' => false,
437  'readFolder' => false,
438  'copyFolder' => false,
439  'moveFolder' => false,
440  'renameFolder' => false,
441  'writeFolder' => false,
442  'deleteFolder' => false,
443  'recursivedeleteFolder' => false
444  ]
445  ],
446  'Standard folder permissions' => [
447  'addFolder,readFolder,moveFolder,renameFolder,writeFolder,deleteFolder',
448  [
449  'addFile' => false,
450  'readFile' => false,
451  'writeFile' => false,
452  'copyFile' => false,
453  'moveFile' => false,
454  'renameFile' => false,
455  'deleteFile' => false,
456  'addFolder' => true,
457  'readFolder' => true,
458  'writeFolder' => true,
459  'copyFolder' => false,
460  'moveFolder' => true,
461  'renameFolder' => true,
462  'deleteFolder' => true,
463  'recursivedeleteFolder' => false
464  ]
465  ],
466  'Copy folder allowed' => [
467  'readFolder,copyFolder',
468  [
469  'addFile' => false,
470  'readFile' => false,
471  'writeFile' => false,
472  'copyFile' => false,
473  'moveFile' => false,
474  'renameFile' => false,
475  'deleteFile' => false,
476  'addFolder' => false,
477  'readFolder' => true,
478  'writeFolder' => false,
479  'copyFolder' => true,
480  'moveFolder' => false,
481  'renameFolder' => false,
482  'deleteFolder' => false,
483  'recursivedeleteFolder' => false
484  ]
485  ],
486  'Copy folder and remove subfolders allowed' => [
487  'readFolder,copyFolder,recursivedeleteFolder',
488  [
489  'addFile' => false,
490  'readFile' => false,
491  'writeFile' => false,
492  'copyFile' => false,
493  'moveFile' => false,
494  'renameFile' => false,
495  'deleteFile' => false,
496  'addFolder' => false,
497  'readFolder' => true,
498  'writeFolder' => false,
499  'copyFolder' => true,
500  'moveFolder' => false,
501  'renameFolder' => false,
502  'deleteFolder' => false,
503  'recursivedeleteFolder' => true
504  ]
505  ],
506  ];
507  }
508 
517  public function ‪getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin(string $permissionValue, array $expectedPermissions): void
518  {
520  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
521  ->setMethods(['isAdmin', 'getTSConfig'])
522  ->getMock();
523 
524  $subject
525  ->expects(self::any())
526  ->method('isAdmin')
527  ->willReturn(false);
528 
529  $subject
530  ->expects(self::any())
531  ->method('getTSConfig')
532  ->willReturn([]);
533  $subject->groupData['file_permissions'] = $permissionValue;
534  self::assertEquals($expectedPermissions, $subject->getFilePermissions());
535  }
536 
541  {
543  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
544  ->setMethods(['isAdmin'])
545  ->getMock();
546 
547  $subject
548  ->expects(self::any())
549  ->method('isAdmin')
550  ->willReturn(true);
551 
552  $expectedPermissions = [
553  'addFile' => true,
554  'readFile' => true,
555  'writeFile' => true,
556  'copyFile' => true,
557  'moveFile' => true,
558  'renameFile' => true,
559  'deleteFile' => true,
560  'addFolder' => true,
561  'readFolder' => true,
562  'writeFolder' => true,
563  'copyFolder' => true,
564  'moveFolder' => true,
565  'renameFolder' => true,
566  'deleteFolder' => true,
567  'recursivedeleteFolder' => true
568  ];
569 
570  self::assertEquals($expectedPermissions, $subject->getFilePermissions());
571  }
572 
577  {
579  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
580  ->setMethods(['getTSConfig'])
581  ->getMock();
582  $subject->method('getTSConfig')->with()->willReturn([
583  'options.' => [
584  'alertPopups' => 1
585  ],
586  ]);
587  self::assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
588  self::assertFalse($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
589  }
590 
595  {
597  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
598  ->setMethods(['getTSConfig'])
599  ->getMock();
600  $subject->method('getTSConfig')->with()->willReturn([
601  'options.' => [
602  'alertPopups' => 3
603  ],
604  ]);
605  self::assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
606  self::assertTrue($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
607  }
608 
620  public function ‪jsConfirmationAllowsUnsettingBitsInValue($jsConfirmation, $typeChangeAllowed, $copyMovePasteAllowed, $deleteAllowed, $feEditAllowed, $otherAllowed): void
621  {
622  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
623  ->setMethods(['getTSConfig'])
624  ->getMock();
625  $subject->method('getTSConfig')->with()->willReturn([
626  'options.' => [
627  'alertPopups' => $jsConfirmation
628  ],
629  ]);
630  self::assertEquals($typeChangeAllowed, $subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
631  self::assertEquals($copyMovePasteAllowed, $subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
632  self::assertEquals($deleteAllowed, $subject->jsConfirmation(‪JsConfirmation::DELETE));
633  self::assertEquals($feEditAllowed, $subject->jsConfirmation(‪JsConfirmation::FE_EDIT));
634  self::assertEquals($otherAllowed, $subject->jsConfirmation(‪JsConfirmation::OTHER));
635  }
636 
640  public function ‪jsConfirmationsWithUnsetBits(): array
641  {
642  return [
643  'All except "type change" and "copy/move/paste"' => [
644  252,
645  false,
646  false,
647  true,
648  true,
649  true,
650  ],
651  'All except "other"' => [
652  127,
653  true,
654  true,
655  true,
656  true,
657  false,
658  ],
659  ];
660  }
661 
666  {
668  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
669  ->setMethods(['getTSConfig'])
670  ->getMock();
671  $subject->method('getTSConfig')->with()->willReturn([
672  'options.' => [
673  'alertPopups' => 0
674  ],
675  ]);
676  self::assertFalse($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
677  self::assertFalse($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
678  }
679 
684  {
686  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
687  ->setMethods(['getTSConfig'])
688  ->getMock();
689 
690  self::assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
691  }
692 
704  {
705  return [
706  'for admin' => [
707  1,
708  true,
709  '',
710  ' 1=1'
711  ],
712  'for admin with groups' => [
713  11,
714  true,
715  '1,2',
716  ' 1=1'
717  ],
718  'for user' => [
719  2,
720  false,
721  '',
722  ' ((`pages`.`perms_everybody` & 2 = 2) OR' .
723  ' ((`pages`.`perms_userid` = 123) AND (`pages`.`perms_user` & 2 = 2)))'
724  ],
725  'for user with groups' => [
726  8,
727  false,
728  '1,2',
729  ' ((`pages`.`perms_everybody` & 8 = 8) OR' .
730  ' ((`pages`.`perms_userid` = 123) AND (`pages`.`perms_user` & 8 = 8))' .
731  ' OR ((`pages`.`perms_groupid` IN (1, 2)) AND (`pages`.`perms_group` & 8 = 8)))'
732  ],
733  ];
734  }
735 
744  public function ‪getPagePermissionsClauseWithValidUser(int $perms, bool $admin, string $groups, string $expected): void
745  {
746  // We only need to setup the mocking for the non-admin cases
747  // If this setup is done for admin cases the FIFO behavior
748  // of GeneralUtility::addInstance will influence other tests
749  // as the ConnectionPool is never used!
750  if (!$admin) {
752  $connectionProphecy = $this->prophesize(Connection::class);
753  $connectionProphecy->getDatabasePlatform()->willReturn(new MockPlatform());
754  $connectionProphecy->quoteIdentifier(Argument::cetera())->will(function (‪$args) {
755  return '`' . str_replace('.', '`.`', ‪$args[0]) . '`';
756  });
757 
759  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
760  $queryBuilderProphecy->expr()->willReturn(
761  new ExpressionBuilder($connectionProphecy->reveal())
762  );
763 
765  $databaseProphecy = $this->prophesize(ConnectionPool::class);
766  $databaseProphecy->getQueryBuilderForTable('pages')->willReturn($queryBuilderProphecy->reveal());
767  // Shift previously added instance
768  GeneralUtility::makeInstance(ConnectionPool::class);
769  GeneralUtility::addInstance(ConnectionPool::class, $databaseProphecy->reveal());
770  }
771 
773  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
774  ->setMethods(['isAdmin'])
775  ->getMock();
776  $subject->setLogger(new NullLogger());
777  $subject->expects(self::any())
778  ->method('isAdmin')
779  ->willReturn($admin);
780 
781  $subject->user = ['uid' => 123];
782  $subject->groupList = $groups;
783 
784  self::assertEquals($expected, $subject->getPagePermsClause($perms));
785  }
786 
794  public function ‪checkAuthModeReturnsExpectedValue(string $theValue, string $authMode, bool $expectedResult)
795  {
797  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
798  ->disableOriginalConstructor()
799  ->onlyMethods(['isAdmin'])
800  ->getMock();
801 
802  $subject
803  ->expects(self::any())
804  ->method('isAdmin')
805  ->willReturn(false);
806 
807  $subject->groupData['explicit_allowdeny'] =
808  'dummytable:dummyfield:explicitly_allowed_value:ALLOW,'
809  . 'dummytable:dummyfield:explicitly_denied_value:DENY';
810 
811  $result = $subject->checkAuthMode('dummytable', 'dummyfield', $theValue, $authMode);
812  self::assertEquals($expectedResult, $result);
813  }
814 
815  public function ‪checkAuthModeReturnsExpectedValueDataProvider(): array
816  {
817  return [
818  'explicit allow, not allowed value' => [
819  'non_allowed_field',
820  'explicitAllow',
821  false,
822  ],
823  'explicit allow, allowed value' => [
824  'explicitly_allowed_value',
825  'explicitAllow',
826  true,
827  ],
828  'explicit deny, not denied value' => [
829  'non_denied_field',
830  'explicitDeny',
831  true,
832  ],
833  'explicit deny, denied value' => [
834  'explicitly_denied_value',
835  'explicitDeny',
836  false,
837  ],
838  'invalid value colon' => [
839  'containing:invalid:chars',
840  'does not matter',
841  false,
842  ],
843  'invalid value comma' => [
844  'containing,invalid,chars',
845  'does not matter',
846  false,
847  ],
848  'blank value' => [
849  '',
850  'does not matter',
851  true,
852  ],
853  'divider' => [
854  '--div--',
855  'explicitAllow',
856  true,
857  ],
858  ];
859  }
860 }
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationReturnsTrueIfPassedValueEqualsConfiguration
‪jsConfirmationReturnsTrueIfPassedValueEqualsConfiguration()
Definition: BackendUserAuthenticationTest.php:575
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:35
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdminDataProvider
‪array getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdminDataProvider()
Definition: BackendUserAuthenticationTest.php:402
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\checkAuthModeReturnsExpectedValueDataProvider
‪checkAuthModeReturnsExpectedValueDataProvider()
Definition: BackendUserAuthenticationTest.php:814
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAllowsUnsettingBitsInValue
‪jsConfirmationAllowsUnsettingBitsInValue($jsConfirmation, $typeChangeAllowed, $copyMovePasteAllowed, $deleteAllowed, $feEditAllowed, $otherAllowed)
Definition: BackendUserAuthenticationTest.php:619
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationReturnsTrueIfConfigurationIsMissing
‪jsConfirmationReturnsTrueIfConfigurationIsMissing()
Definition: BackendUserAuthenticationTest.php:682
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\set
‪static set($classNameOrType, AbstractFormProtection $instance)
Definition: FormProtectionFactory.php:209
‪TYPO3\CMS\Core\Tests\Unit\Authentication
Definition: AbstractUserAuthenticationTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\checkAuthModeReturnsExpectedValue
‪checkAuthModeReturnsExpectedValue(string $theValue, string $authMode, bool $expectedResult)
Definition: BackendUserAuthenticationTest.php:793
‪TYPO3\CMS\Core\FormProtection\BackendFormProtection
Definition: BackendFormProtection.php:75
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin
‪getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin(string $permissionValue, array $expectedPermissions)
Definition: BackendUserAuthenticationTest.php:516
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\purgeInstances
‪static purgeInstances()
Definition: FormProtectionFactory.php:219
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\COPY_MOVE_PASTE
‪const COPY_MOVE_PASTE
Definition: JsConfirmation.php:34
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromTsConfigIntoAccountIfUserIsNotAdmin
‪getFilePermissionsTakesUserDefaultPermissionsFromTsConfigIntoAccountIfUserIsNotAdmin(array $userTsConfiguration)
Definition: BackendUserAuthenticationTest.php:180
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\FE_EDIT
‪const FE_EDIT
Definition: JsConfirmation.php:44
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:52
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\DELETE
‪const DELETE
Definition: JsConfirmation.php:39
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\setUp
‪setUp()
Definition: BackendUserAuthenticationTest.php:64
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageOverwritesDefaultPermissions
‪getFilePermissionsFromStorageOverwritesDefaultPermissions(array $defaultPermissions, $storageUid, array $storagePermissions, array $expectedPermissions)
Definition: BackendUserAuthenticationTest.php:322
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\OTHER
‪const OTHER
Definition: JsConfirmation.php:49
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform
Definition: MockPlatform.php:22
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\tearDown
‪tearDown()
Definition: BackendUserAuthenticationTest.php:73
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins
‪getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins(array $defaultPermissions, $storageUid, array $storagePermissions)
Definition: BackendUserAuthenticationTest.php:364
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsGrantsAllPermissionsToAdminUsers
‪getFilePermissionsGrantsAllPermissionsToAdminUsers()
Definition: BackendUserAuthenticationTest.php:539
‪$args
‪$args
Definition: validateRstFiles.php:214
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getPagePermissionsClauseWithValidUserDataProvider
‪array getPagePermissionsClauseWithValidUserDataProvider()
Definition: BackendUserAuthenticationTest.php:702
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:122
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:47
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultAndStoragePermissionsIntoAccountIfUserIsNotAdminDataProvider
‪array getFilePermissionsTakesUserDefaultAndStoragePermissionsIntoAccountIfUserIsNotAdminDataProvider()
Definition: BackendUserAuthenticationTest.php:126
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAlwaysReturnsFalseIfNoConfirmationIsSet
‪jsConfirmationAlwaysReturnsFalseIfNoConfirmationIsSet()
Definition: BackendUserAuthenticationTest.php:664
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\TYPE_CHANGE
‪const TYPE_CHANGE
Definition: JsConfirmation.php:29
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAllowsSettingMultipleBitsInValue
‪jsConfirmationAllowsSettingMultipleBitsInValue()
Definition: BackendUserAuthenticationTest.php:593
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\logoffCleansFormProtectionIfBackendUserIsLoggedIn
‪logoffCleansFormProtectionIfBackendUserIsLoggedIn()
Definition: BackendUserAuthenticationTest.php:85
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\$defaultFilePermissions
‪array $defaultFilePermissions
Definition: BackendUserAuthenticationTest.php:44
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation
Definition: JsConfirmation.php:25
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getPagePermissionsClauseWithValidUser
‪getPagePermissionsClauseWithValidUser(int $perms, bool $admin, string $groups, string $expected)
Definition: BackendUserAuthenticationTest.php:743
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageDataProvider
‪array getFilePermissionsFromStorageDataProvider()
Definition: BackendUserAuthenticationTest.php:218
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest
Definition: BackendUserAuthenticationTest.php:41
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationsWithUnsetBits
‪array jsConfirmationsWithUnsetBits()
Definition: BackendUserAuthenticationTest.php:639