‪TYPO3CMS  9.5
BackendUserAuthenticationTest.php
Go to the documentation of this file.
1 <?php
2 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 
18 use PHPUnit\Framework\MockObject\MockObject;
19 use Prophecy\Argument;
20 use Prophecy\Prophecy\ObjectProphecy;
21 use Psr\Log\NullLogger;
33 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
34 
38 class ‪BackendUserAuthenticationTest extends UnitTestCase
39 {
43  protected ‪$defaultFilePermissions = [
44  // File permissions
45  'addFile' => false,
46  'readFile' => false,
47  'writeFile' => false,
48  'copyFile' => false,
49  'moveFile' => false,
50  'renameFile' => false,
51  'deleteFile' => false,
52  // Folder permissions
53  'addFolder' => false,
54  'readFolder' => false,
55  'writeFolder' => false,
56  'copyFolder' => false,
57  'moveFolder' => false,
58  'renameFolder' => false,
59  'deleteFolder' => false,
60  'recursivedeleteFolder' => false
61  ];
62 
66  protected function ‪tearDown(): void
67  {
69  parent::tearDown();
70  }
71 
73  // Tests concerning the form protection
75 
79  {
81  $connection = $this->prophesize(Connection::class);
82  $connection->delete('sys_lockedrecords', Argument::cetera())->willReturn(1);
83 
85  $connectionPool = $this->prophesize(ConnectionPool::class);
86  $connectionPool->getConnectionForTable(Argument::cetera())->willReturn($connection->reveal());
87 
88  GeneralUtility::addInstance(ConnectionPool::class, $connectionPool->reveal());
89 
91  $formProtection = $this->prophesize(BackendFormProtection::class);
92  $formProtection->clean()->shouldBeCalled();
93 
95  'default',
96  $formProtection->reveal()
97  );
98 
99  ‪$GLOBALS['BE_USER'] = $this->getMockBuilder(BackendUserAuthentication::class)->getMock();
100  ‪$GLOBALS['BE_USER']->user = [
101  'uid' => 4711,
102  'ses_backuserid' => 0,
103  ];
104  ‪$GLOBALS['BE_USER']->setLogger(new NullLogger());
105 
107  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
108  ->setMethods(['dummy'])
109  ->disableOriginalConstructor()
110  ->getMock();
111 
112  $subject->setLogger(new NullLogger());
113  $subject->logoff();
114  }
115 
120  {
121  return [
122  'Only read permissions' => [
123  [
124  'addFile' => 0,
125  'readFile' => 1,
126  'writeFile' => 0,
127  'copyFile' => 0,
128  'moveFile' => 0,
129  'renameFile' => 0,
130  'deleteFile' => 0,
131  'addFolder' => 0,
132  'readFolder' => 1,
133  'copyFolder' => 0,
134  'moveFolder' => 0,
135  'renameFolder' => 0,
136  'writeFolder' => 0,
137  'deleteFolder' => 0,
138  'recursivedeleteFolder' => 0,
139  ]
140  ],
141  'Uploading allowed' => [
142  [
143  'addFile' => 1,
144  'readFile' => 1,
145  'writeFile' => 1,
146  'copyFile' => 1,
147  'moveFile' => 1,
148  'renameFile' => 1,
149  'deleteFile' => 1,
150  'addFolder' => 0,
151  'readFolder' => 1,
152  'copyFolder' => 0,
153  'moveFolder' => 0,
154  'renameFolder' => 0,
155  'writeFolder' => 0,
156  'deleteFolder' => 0,
157  'recursivedeleteFolder' => 0
158  ]
159  ],
160  'One value is enough' => [
161  [
162  'addFile' => 1,
163  ]
164  ],
165  ];
166  }
167 
174  {
176  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
177  ->setMethods(['isAdmin', 'getTSConfig'])
178  ->getMock();
179 
180  $subject
181  ->expects($this->any())
182  ->method('isAdmin')
183  ->will($this->returnValue(false));
184 
185  $subject->setLogger(new NullLogger());
186  $subject
187  ->expects($this->any())
188  ->method('getTSConfig')
189  ->will($this->returnValue([
190  'permissions.' => [
191  'file.' => [
192  'default.' => $userTsConfiguration
193  ],
194  ]
195  ]));
196 
197  $expectedPermissions = array_merge($this->defaultFilePermissions, $userTsConfiguration);
198  array_walk(
199  $expectedPermissions,
200  function (&$value) {
201  $value = (bool)$value;
202  }
203  );
204 
205  $this->assertEquals($expectedPermissions, $subject->getFilePermissions());
206  }
207 
211  public function ‪getFilePermissionsFromStorageDataProvider(): array
212  {
213  $defaultPermissions = [
214  'addFile' => true,
215  'readFile' => true,
216  'writeFile' => true,
217  'copyFile' => true,
218  'moveFile' => true,
219  'renameFile' => true,
220  'deleteFile' => true,
221  'addFolder' => true,
222  'readFolder' => true,
223  'copyFolder' => true,
224  'moveFolder' => true,
225  'renameFolder' => true,
226  'writeFolder' => true,
227  'deleteFolder' => true,
228  'recursivedeleteFolder' => true
229  ];
230 
231  return [
232  'Overwrites given storage permissions with default permissions' => [
233  $defaultPermissions,
234  1,
235  [
236  'addFile' => 0,
237  'recursivedeleteFolder' =>0
238  ],
239  [
240  'addFile' => 0,
241  'readFile' => 1,
242  'writeFile' => 1,
243  'copyFile' => 1,
244  'moveFile' => 1,
245  'renameFile' => 1,
246  'deleteFile' => 1,
247  'addFolder' => 1,
248  'readFolder' => 1,
249  'copyFolder' => 1,
250  'moveFolder' => 1,
251  'renameFolder' => 1,
252  'writeFolder' => 1,
253  'deleteFolder' => 1,
254  'recursivedeleteFolder' => 0
255  ]
256  ],
257  'Overwrites given storage 0 permissions with default permissions' => [
258  $defaultPermissions,
259  0,
260  [
261  'addFile' => 0,
262  'recursivedeleteFolder' =>0
263  ],
264  [
265  'addFile' => false,
266  'readFile' => true,
267  'writeFile' => true,
268  'copyFile' => true,
269  'moveFile' => true,
270  'renameFile' => true,
271  'deleteFile' => true,
272  'addFolder' => true,
273  'readFolder' => true,
274  'copyFolder' => true,
275  'moveFolder' => true,
276  'renameFolder' => true,
277  'writeFolder' => true,
278  'deleteFolder' => true,
279  'recursivedeleteFolder' => false
280  ]
281  ],
282  'Returns default permissions if no storage permissions are found' => [
283  $defaultPermissions,
284  1,
285  [],
286  [
287  'addFile' => true,
288  'readFile' => true,
289  'writeFile' => true,
290  'copyFile' => true,
291  'moveFile' => true,
292  'renameFile' => true,
293  'deleteFile' => true,
294  'addFolder' => true,
295  'readFolder' => true,
296  'copyFolder' => true,
297  'moveFolder' => true,
298  'renameFolder' => true,
299  'writeFolder' => true,
300  'deleteFolder' => true,
301  'recursivedeleteFolder' => true
302  ]
303  ],
304  ];
305  }
306 
315  public function ‪getFilePermissionsFromStorageOverwritesDefaultPermissions(array $defaultPermissions, $storageUid, array $storagePermissions, array $expectedPermissions): void
316  {
318  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
319  ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
320  ->getMock();
321  $storageMock = $this->createMock(ResourceStorage::class);
322  $storageMock->expects($this->any())->method('getUid')->will($this->returnValue($storageUid));
323 
324  $subject
325  ->expects($this->any())
326  ->method('isAdmin')
327  ->will($this->returnValue(false));
328 
329  $subject
330  ->expects($this->any())
331  ->method('getFilePermissions')
332  ->will($this->returnValue($defaultPermissions));
333 
334  $subject
335  ->expects($this->any())
336  ->method('getTSConfig')
337  ->will($this->returnValue([
338  'permissions.' => [
339  'file.' => [
340  'storage.' => [
341  $storageUid . '.' => $storagePermissions
342  ],
343  ],
344  ]
345  ]));
346 
347  $this->assertEquals($expectedPermissions, $subject->getFilePermissionsForStorage($storageMock));
348  }
349 
357  public function ‪getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins(array $defaultPermissions, $storageUid, array $storagePermissions): void
358  {
360  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
361  ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
362  ->getMock();
363  $storageMock = $this->createMock(ResourceStorage::class);
364  $storageMock->expects($this->any())->method('getUid')->will($this->returnValue($storageUid));
365 
366  $subject
367  ->expects($this->any())
368  ->method('isAdmin')
369  ->will($this->returnValue(true));
370 
371  $subject
372  ->expects($this->any())
373  ->method('getFilePermissions')
374  ->will($this->returnValue($defaultPermissions));
375 
376  $subject
377  ->expects($this->any())
378  ->method('getTSConfig')
379  ->will($this->returnValue([
380  'permissions.' => [
381  'file.' => [
382  'storage.' => [
383  $storageUid . '.' => $storagePermissions
384  ],
385  ],
386  ]
387  ]));
388 
389  $this->assertEquals($defaultPermissions, $subject->getFilePermissionsForStorage($storageMock));
390  }
391 
396  {
397  return [
398  'No permission' => [
399  '',
400  [
401  'addFile' => false,
402  'readFile' => false,
403  'writeFile' => false,
404  'copyFile' => false,
405  'moveFile' => false,
406  'renameFile' => false,
407  'deleteFile' => false,
408  'addFolder' => false,
409  'readFolder' => false,
410  'copyFolder' => false,
411  'moveFolder' => false,
412  'renameFolder' => false,
413  'writeFolder' => false,
414  'deleteFolder' => false,
415  'recursivedeleteFolder' => false
416  ]
417  ],
418  'Standard file permissions' => [
419  'addFile,readFile,writeFile,copyFile,moveFile,renameFile,deleteFile',
420  [
421  'addFile' => true,
422  'readFile' => true,
423  'writeFile' => true,
424  'copyFile' => true,
425  'moveFile' => true,
426  'renameFile' => true,
427  'deleteFile' => true,
428  'addFolder' => false,
429  'readFolder' => false,
430  'copyFolder' => false,
431  'moveFolder' => false,
432  'renameFolder' => false,
433  'writeFolder' => false,
434  'deleteFolder' => false,
435  'recursivedeleteFolder' => false
436  ]
437  ],
438  'Standard folder permissions' => [
439  'addFolder,readFolder,moveFolder,renameFolder,writeFolder,deleteFolder',
440  [
441  'addFile' => false,
442  'readFile' => false,
443  'writeFile' => false,
444  'copyFile' => false,
445  'moveFile' => false,
446  'renameFile' => false,
447  'deleteFile' => false,
448  'addFolder' => true,
449  'readFolder' => true,
450  'writeFolder' => true,
451  'copyFolder' => false,
452  'moveFolder' => true,
453  'renameFolder' => true,
454  'deleteFolder' => true,
455  'recursivedeleteFolder' => false
456  ]
457  ],
458  'Copy folder allowed' => [
459  'readFolder,copyFolder',
460  [
461  'addFile' => false,
462  'readFile' => false,
463  'writeFile' => false,
464  'copyFile' => false,
465  'moveFile' => false,
466  'renameFile' => false,
467  'deleteFile' => false,
468  'addFolder' => false,
469  'readFolder' => true,
470  'writeFolder' => false,
471  'copyFolder' => true,
472  'moveFolder' => false,
473  'renameFolder' => false,
474  'deleteFolder' => false,
475  'recursivedeleteFolder' => false
476  ]
477  ],
478  'Copy folder and remove subfolders allowed' => [
479  'readFolder,copyFolder,recursivedeleteFolder',
480  [
481  'addFile' => false,
482  'readFile' => false,
483  'writeFile' => false,
484  'copyFile' => false,
485  'moveFile' => false,
486  'renameFile' => false,
487  'deleteFile' => false,
488  'addFolder' => false,
489  'readFolder' => true,
490  'writeFolder' => false,
491  'copyFolder' => true,
492  'moveFolder' => false,
493  'renameFolder' => false,
494  'deleteFolder' => false,
495  'recursivedeleteFolder' => true
496  ]
497  ],
498  ];
499  }
500 
509  public function ‪getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin(string $permissionValue, array $expectedPermissions): void
510  {
512  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
513  ->setMethods(['isAdmin', 'getTSConfig'])
514  ->getMock();
515 
516  $subject
517  ->expects($this->any())
518  ->method('isAdmin')
519  ->will($this->returnValue(false));
520 
521  $subject
522  ->expects($this->any())
523  ->method('getTSConfig')
524  ->will($this->returnValue([]));
525  $subject->groupData['file_permissions'] = $permissionValue;
526  $this->assertEquals($expectedPermissions, $subject->getFilePermissions());
527  }
528 
533  {
535  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
536  ->setMethods(['isAdmin'])
537  ->getMock();
538 
539  $subject
540  ->expects($this->any())
541  ->method('isAdmin')
542  ->will($this->returnValue(true));
543 
544  $expectedPermissions = [
545  'addFile' => true,
546  'readFile' => true,
547  'writeFile' => true,
548  'copyFile' => true,
549  'moveFile' => true,
550  'renameFile' => true,
551  'deleteFile' => true,
552  'addFolder' => true,
553  'readFolder' => true,
554  'writeFolder' => true,
555  'copyFolder' => true,
556  'moveFolder' => true,
557  'renameFolder' => true,
558  'deleteFolder' => true,
559  'recursivedeleteFolder' => true
560  ];
561 
562  $this->assertEquals($expectedPermissions, $subject->getFilePermissions());
563  }
564 
569  {
571  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
572  ->setMethods(['getTSConfig'])
573  ->getMock();
574  $subject->method('getTSConfig')->with()->willReturn([
575  'options.' => [
576  'alertPopups' => 1
577  ],
578  ]);
579  $this->assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
580  $this->assertFalse($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
581  }
582 
587  {
589  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
590  ->setMethods(['getTSConfig'])
591  ->getMock();
592  $subject->method('getTSConfig')->with()->willReturn([
593  'options.' => [
594  'alertPopups' => 3
595  ],
596  ]);
597  $this->assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
598  $this->assertTrue($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
599  }
600 
612  public function ‪jsConfirmationAllowsUnsettingBitsInValue($jsConfirmation, $typeChangeAllowed, $copyMovePasteAllowed, $deleteAllowed, $feEditAllowed, $otherAllowed): void
613  {
614  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
615  ->setMethods(['getTSConfig'])
616  ->getMock();
617  $subject->method('getTSConfig')->with()->willReturn([
618  'options.' => [
619  'alertPopups' => $jsConfirmation
620  ],
621  ]);
622  $this->assertEquals($typeChangeAllowed, $subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
623  $this->assertEquals($copyMovePasteAllowed, $subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
624  $this->assertEquals($deleteAllowed, $subject->jsConfirmation(‪JsConfirmation::DELETE));
625  $this->assertEquals($feEditAllowed, $subject->jsConfirmation(‪JsConfirmation::FE_EDIT));
626  $this->assertEquals($otherAllowed, $subject->jsConfirmation(‪JsConfirmation::OTHER));
627  }
628 
632  public function ‪jsConfirmationsWithUnsetBits(): array
633  {
634  return [
635  'All except "type change" and "copy/move/paste"' => [
636  252,
637  false,
638  false,
639  true,
640  true,
641  true,
642  ],
643  'All except "other"' => [
644  127,
645  true,
646  true,
647  true,
648  true,
649  false,
650  ],
651  ];
652  }
653 
658  {
660  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
661  ->setMethods(['getTSConfig'])
662  ->getMock();
663  $subject->method('getTSConfig')->with()->willReturn([
664  'options.' => [
665  'alertPopups' => 0
666  ],
667  ]);
668  $this->assertFalse($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
669  $this->assertFalse($subject->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE));
670  }
671 
676  {
678  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
679  ->setMethods(['getTSConfig'])
680  ->getMock();
681 
682  $this->assertTrue($subject->jsConfirmation(‪JsConfirmation::TYPE_CHANGE));
683  }
684 
696  {
697  return [
698  'for admin' => [
699  1,
700  true,
701  '',
702  ' 1=1'
703  ],
704  'for admin with groups' => [
705  11,
706  true,
707  '1,2',
708  ' 1=1'
709  ],
710  'for user' => [
711  2,
712  false,
713  '',
714  ' ((`pages`.`perms_everybody` & 2 = 2) OR' .
715  ' ((`pages`.`perms_userid` = 123) AND (`pages`.`perms_user` & 2 = 2)))'
716  ],
717  'for user with groups' => [
718  8,
719  false,
720  '1,2',
721  ' ((`pages`.`perms_everybody` & 8 = 8) OR' .
722  ' ((`pages`.`perms_userid` = 123) AND (`pages`.`perms_user` & 8 = 8))' .
723  ' OR ((`pages`.`perms_groupid` IN (1, 2)) AND (`pages`.`perms_group` & 8 = 8)))'
724  ],
725  ];
726  }
727 
736  public function ‪getPagePermissionsClauseWithValidUser(int $perms, bool $admin, string $groups, string $expected): void
737  {
738  // We only need to setup the mocking for the non-admin cases
739  // If this setup is done for admin cases the FIFO behavior
740  // of GeneralUtility::addInstance will influence other tests
741  // as the ConnectionPool is never used!
742  if (!$admin) {
744  $connectionProphecy = $this->prophesize(Connection::class);
745  $connectionProphecy->getDatabasePlatform()->willReturn(new ‪MockPlatform());
746  $connectionProphecy->quoteIdentifier(Argument::cetera())->will(function (‪$args) {
747  return '`' . str_replace('.', '`.`', ‪$args[0]) . '`';
748  });
749 
751  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
752  $queryBuilderProphecy->expr()->willReturn(
753  new ‪ExpressionBuilder($connectionProphecy->reveal())
754  );
755 
757  $databaseProphecy = $this->prophesize(ConnectionPool::class);
758  $databaseProphecy->getQueryBuilderForTable('pages')->willReturn($queryBuilderProphecy->reveal());
759  // Shift previously added instance
760  GeneralUtility::makeInstance(ConnectionPool::class);
761  GeneralUtility::addInstance(ConnectionPool::class, $databaseProphecy->reveal());
762  }
763 
765  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
766  ->setMethods(['isAdmin'])
767  ->getMock();
768  $subject->setLogger(new NullLogger());
769  $subject->expects($this->any())
770  ->method('isAdmin')
771  ->will($this->returnValue($admin));
772 
773  $subject->user = ['uid' => 123];
774  $subject->groupList = $groups;
775 
776  $this->assertEquals($expected, $subject->getPagePermsClause($perms));
777  }
778 
786  public function ‪checkAuthModeReturnsExpectedValue(string $theValue, string $authMode, bool $expectedResult)
787  {
789  $subject = $this->getMockBuilder(BackendUserAuthentication::class)
790  ->disableOriginalConstructor()
791  ->setMethods(['isAdmin'])
792  ->getMock();
793 
794  $subject
795  ->expects(self::any())
796  ->method('isAdmin')
797  ->willReturn(false);
798 
799  $subject->groupData['explicit_allowdeny'] =
800  'dummytable:dummyfield:explicitly_allowed_value:ALLOW,'
801  . 'dummytable:dummyfield:explicitly_denied_value:DENY';
802 
803  $result = $subject->checkAuthMode('dummytable', 'dummyfield', $theValue, $authMode);
804  self::assertEquals($expectedResult, $result);
805  }
806 
807  public function ‪checkAuthModeReturnsExpectedValueDataProvider(): array
808  {
809  return [
810  'explicit allow, not allowed value' => [
811  'non_allowed_field',
812  'explicitAllow',
813  false,
814  ],
815  'explicit allow, allowed value' => [
816  'explicitly_allowed_value',
817  'explicitAllow',
818  true,
819  ],
820  'explicit deny, not denied value' => [
821  'non_denied_field',
822  'explicitDeny',
823  true,
824  ],
825  'explicit deny, denied value' => [
826  'explicitly_denied_value',
827  'explicitDeny',
828  false,
829  ],
830  'invalid value colon' => [
831  'containing:invalid:chars',
832  'does not matter',
833  false,
834  ],
835  'invalid value comma' => [
836  'containing,invalid,chars',
837  'does not matter',
838  false,
839  ],
840  'blank value' => [
841  '',
842  'does not matter',
843  true,
844  ],
845  'divider' => [
846  '--div--',
847  'explicitAllow',
848  true,
849  ],
850  ];
851  }
852 }
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationReturnsTrueIfPassedValueEqualsConfiguration
‪jsConfirmationReturnsTrueIfPassedValueEqualsConfiguration()
Definition: BackendUserAuthenticationTest.php:567
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:33
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdminDataProvider
‪array getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdminDataProvider()
Definition: BackendUserAuthenticationTest.php:394
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\checkAuthModeReturnsExpectedValueDataProvider
‪checkAuthModeReturnsExpectedValueDataProvider()
Definition: BackendUserAuthenticationTest.php:806
‪$args
‪$args
Definition: checkIntegrityCsvFixtures.php:230
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAllowsUnsettingBitsInValue
‪jsConfirmationAllowsUnsettingBitsInValue($jsConfirmation, $typeChangeAllowed, $copyMovePasteAllowed, $deleteAllowed, $feEditAllowed, $otherAllowed)
Definition: BackendUserAuthenticationTest.php:611
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationReturnsTrueIfConfigurationIsMissing
‪jsConfirmationReturnsTrueIfConfigurationIsMissing()
Definition: BackendUserAuthenticationTest.php:674
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\set
‪static set($classNameOrType, AbstractFormProtection $instance)
Definition: FormProtectionFactory.php:207
‪TYPO3\CMS\Core\Tests\Unit\Authentication
Definition: AbstractUserAuthenticationTest.php:3
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\checkAuthModeReturnsExpectedValue
‪checkAuthModeReturnsExpectedValue(string $theValue, string $authMode, bool $expectedResult)
Definition: BackendUserAuthenticationTest.php:785
‪TYPO3\CMS\Core\FormProtection\BackendFormProtection
Definition: BackendFormProtection.php:73
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin
‪getFilePermissionsTakesUserDefaultPermissionsFromRecordIntoAccountIfUserIsNotAdmin(string $permissionValue, array $expectedPermissions)
Definition: BackendUserAuthenticationTest.php:508
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\purgeInstances
‪static purgeInstances()
Definition: FormProtectionFactory.php:217
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\COPY_MOVE_PASTE
‪const COPY_MOVE_PASTE
Definition: JsConfirmation.php:33
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsTakesUserDefaultPermissionsFromTsConfigIntoAccountIfUserIsNotAdmin
‪getFilePermissionsTakesUserDefaultPermissionsFromTsConfigIntoAccountIfUserIsNotAdmin(array $userTsConfiguration)
Definition: BackendUserAuthenticationTest.php:172
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\FE_EDIT
‪const FE_EDIT
Definition: JsConfirmation.php:43
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:47
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\DELETE
‪const DELETE
Definition: JsConfirmation.php:38
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageOverwritesDefaultPermissions
‪getFilePermissionsFromStorageOverwritesDefaultPermissions(array $defaultPermissions, $storageUid, array $storagePermissions, array $expectedPermissions)
Definition: BackendUserAuthenticationTest.php:314
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\OTHER
‪const OTHER
Definition: JsConfirmation.php:48
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform
Definition: MockPlatform.php:21
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\tearDown
‪tearDown()
Definition: BackendUserAuthenticationTest.php:65
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins
‪getFilePermissionsFromStorageAlwaysReturnsDefaultPermissionsForAdmins(array $defaultPermissions, $storageUid, array $storagePermissions)
Definition: BackendUserAuthenticationTest.php:356
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsGrantsAllPermissionsToAdminUsers
‪getFilePermissionsGrantsAllPermissionsToAdminUsers()
Definition: BackendUserAuthenticationTest.php:531
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:31
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getPagePermissionsClauseWithValidUserDataProvider
‪array getPagePermissionsClauseWithValidUserDataProvider()
Definition: BackendUserAuthenticationTest.php:694
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:74
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:45
‪$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:118
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAlwaysReturnsFalseIfNoConfirmationIsSet
‪jsConfirmationAlwaysReturnsFalseIfNoConfirmationIsSet()
Definition: BackendUserAuthenticationTest.php:656
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\TYPE_CHANGE
‪const TYPE_CHANGE
Definition: JsConfirmation.php:28
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationAllowsSettingMultipleBitsInValue
‪jsConfirmationAllowsSettingMultipleBitsInValue()
Definition: BackendUserAuthenticationTest.php:585
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\logoffCleansFormProtectionIfBackendUserIsLoggedIn
‪logoffCleansFormProtectionIfBackendUserIsLoggedIn()
Definition: BackendUserAuthenticationTest.php:77
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\$defaultFilePermissions
‪array $defaultFilePermissions
Definition: BackendUserAuthenticationTest.php:42
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation
Definition: JsConfirmation.php:24
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getPagePermissionsClauseWithValidUser
‪getPagePermissionsClauseWithValidUser(int $perms, bool $admin, string $groups, string $expected)
Definition: BackendUserAuthenticationTest.php:735
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\getFilePermissionsFromStorageDataProvider
‪array getFilePermissionsFromStorageDataProvider()
Definition: BackendUserAuthenticationTest.php:210
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest
Definition: BackendUserAuthenticationTest.php:39
‪TYPO3\CMS\Core\Tests\Unit\Authentication\BackendUserAuthenticationTest\jsConfirmationsWithUnsetBits
‪array jsConfirmationsWithUnsetBits()
Definition: BackendUserAuthenticationTest.php:631