‪TYPO3CMS  ‪main
ModifyEditFormUserAccessEvent.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 
21 
27 {
28  private bool ‪$userHasAccess;
29 
33  public function ‪__construct(
34  private readonly ?‪AccessDeniedException $exception,
35  private readonly string $tableName,
36  private readonly string $command,
37  private readonly array $databaseRow,
38  ) {
39  $this->userHasAccess = $this->exception === null;
40  }
41 
45  public function ‪allowUserAccess(): void
46  {
47  $this->userHasAccess = true;
48  }
49 
53  public function ‪denyUserAccess(): void
54  {
55  $this->userHasAccess = false;
56  }
57 
61  public function ‪doesUserHaveAccess(): bool
62  {
64  }
65 
71  {
72  return $this->exception;
73  }
74 
78  public function ‪getTableName(): string
79  {
80  return $this->tableName;
81  }
82 
87  public function ‪getCommand(): string
88  {
89  return $this->command;
90  }
91 
95  public function ‪getDatabaseRow(): array
96  {
97  return $this->databaseRow;
98  }
99 }
‪TYPO3\CMS\Backend\Form\Event
Definition: CustomFileControlsEvent.php:18
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\denyUserAccess
‪denyUserAccess()
Definition: ModifyEditFormUserAccessEvent.php:53
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\getCommand
‪getCommand()
Definition: ModifyEditFormUserAccessEvent.php:87
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\$userHasAccess
‪bool $userHasAccess
Definition: ModifyEditFormUserAccessEvent.php:28
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\getDatabaseRow
‪getDatabaseRow()
Definition: ModifyEditFormUserAccessEvent.php:95
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\getAccessDeniedException
‪getAccessDeniedException()
Definition: ModifyEditFormUserAccessEvent.php:70
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\getTableName
‪getTableName()
Definition: ModifyEditFormUserAccessEvent.php:78
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\__construct
‪__construct(private readonly ?AccessDeniedException $exception, private readonly string $tableName, private readonly string $command, private readonly array $databaseRow,)
Definition: ModifyEditFormUserAccessEvent.php:33
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\doesUserHaveAccess
‪doesUserHaveAccess()
Definition: ModifyEditFormUserAccessEvent.php:61
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent
Definition: ModifyEditFormUserAccessEvent.php:27
‪TYPO3\CMS\Backend\Form\Event\ModifyEditFormUserAccessEvent\allowUserAccess
‪allowUserAccess()
Definition: ModifyEditFormUserAccessEvent.php:45
‪TYPO3\CMS\Backend\Form\Exception\AccessDeniedException
Definition: AccessDeniedException.php:25