Skip to content
Snippets Groups Projects
Commit c1df89b1 authored by Chris Müller's avatar Chris Müller Committed by Stefan Bürk
Browse files

[DOCS] Improve doc comments for ModifyEditFormUserAccessEvent

Method descriptions are added from the changelog here:
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-98304-PSR-14EventForModifyingEditFormUserAccess.html
to the source code. This also eases usage for coders who use the code
as documentation.

Resolves: #98401
Related: #98304
Releases: main
Change-Id: I218a386efba863c92af694e8364c8b6400a67804
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75833


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 65f7db2d
Branches
Tags
No related merge requests found
......@@ -27,6 +27,9 @@ final class ModifyEditFormUserAccessEvent
{
private bool $userHasAccess;
/**
* @param 'new'|'edit' $command
*/
public function __construct(
private readonly ?AccessDeniedException $exception,
private readonly string $tableName,
......@@ -36,36 +39,59 @@ final class ModifyEditFormUserAccessEvent
$this->userHasAccess = $this->exception === null;
}
/**
* Allows user access to the editing form
*/
public function allowUserAccess(): void
{
$this->userHasAccess = true;
}
/**
* Denies user access to the editing form
*/
public function denyUserAccess(): void
{
$this->userHasAccess = false;
}
/**
* Returns the current user access state
*/
public function doesUserHaveAccess(): bool
{
return $this->userHasAccess;
}
/**
* If Core's DataProvider previously denied access, this returns the corresponding
* exception, `null` otherwise
*/
public function getAccessDeniedException(): ?AccessDeniedException
{
return $this->exception;
}
/**
* Returns the table name of the record in question
*/
public function getTableName(): string
{
return $this->tableName;
}
/**
* Returns the requested command, either `new` or `edit`
* @return 'new'|'edit'
*/
public function getCommand(): string
{
return $this->command;
}
/**
* Returns the record's database row
*/
public function getDatabaseRow(): array
{
return $this->databaseRow;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment