ResourceIdentifier
final readonly class \
Names a resource by a type and an identifier within that type, e.g. the page type "254" or the custom option "tx_news:publish".
It is the subject of isGranted() for resources that have no object of their own: isGranted(Scope::WRITE, ResourceIdentifier::pageType(254)). Resources with an object are checked on that object instead, e.g. a table on its TcaSchema or a module on its ModuleInterface. A language is checked on its SiteLanguage, or on its id where no site is at hand.
The constants name the types TYPO3 Core grants through backend groups. The ResourceVoter decides on those without an object of their own, the LanguageVoter on languages; the types table, field, module and widget are only used by the voters of TYPO3 Core towards the policy decision point. An extension may use a type of its own, prefixed with its extension key, and decides on it with a voter of its own: isGranted(Scope::ACCESS, new ResourceIdentifier('tx_shop_discount', 'staff')). The ResourceVoter abstains on such types.
Internal
not part of TYPO3 Core API yet, still experimental as part of the authentication modernization groundwork
Table of Contents
Constants
- ADMIN_ONLY_TABLE : string = 'admin_only_table'
- CUSTOM_OPTION : string = 'custom_option'
- FIELD : string = 'field'
- FIELD_VALUE : string = 'field_value'
- LANGUAGE : string = 'language'
- MFA_PROVIDER : string = 'mfa_provider'
- MODULE : string = 'module'
- PAGE_TYPE : string = 'page_type'
- TABLE : string = 'table'
- WIDGET : string = 'widget'
Properties
- $identifier : string
- $type : string
Methods
- __construct() : mixed
- adminOnlyTable() : self
- customOption() : self
- field() : self
- fieldValue() : self
- language() : self
- A language without a site, see the LanguageVoter
- mfaProvider() : self
- module() : self
- pageType() : self
- table() : self
- widget() : self
Constants
ADMIN_ONLY_TABLE
public
string
ADMIN_ONLY_TABLE
= 'admin_only_table'
CUSTOM_OPTION
public
string
CUSTOM_OPTION
= 'custom_option'
FIELD
public
string
FIELD
= 'field'
FIELD_VALUE
public
string
FIELD_VALUE
= 'field_value'
LANGUAGE
public
string
LANGUAGE
= 'language'
MFA_PROVIDER
public
string
MFA_PROVIDER
= 'mfa_provider'
MODULE
public
string
MODULE
= 'module'
PAGE_TYPE
public
string
PAGE_TYPE
= 'page_type'
TABLE
public
string
TABLE
= 'table'
WIDGET
public
string
WIDGET
= 'widget'
Properties
$identifier
public
string
$identifier
$type
public
string
$type
Methods
__construct()
public
__construct(non-empty-string $type, string $identifier) : mixed
Parameters
- $type : non-empty-string
- $identifier : string
adminOnlyTable()
public
static adminOnlyTable(string $table) : self
Parameters
- $table : string
Internal
for the voters of TYPO3 Core, check a TcaSchema instead
Return values
selfcustomOption()
public
static customOption(string $identifier) : self
Parameters
- $identifier : string
-
the option as "group:item"
Return values
selffield()
public
static field(string $table, string $field) : self
Parameters
- $table : string
- $field : string
Internal
for the voters of TYPO3 Core, check a SchemaField instead
Return values
selffieldValue()
public
static fieldValue(string $table, string $field, string $value) : self
Parameters
- $table : string
- $field : string
- $value : string
Return values
selflanguage()
A language without a site, see the LanguageVoter
public
static language(int $languageId) : self
Parameters
- $languageId : int
Return values
selfmfaProvider()
public
static mfaProvider(string $identifier) : self
Parameters
- $identifier : string
Return values
selfmodule()
public
static module(string $identifier) : self
Parameters
- $identifier : string
Internal
for the voters of TYPO3 Core, check a ModuleInterface instead
Return values
selfpageType()
public
static pageType(int $doktype) : self
Parameters
- $doktype : int
Return values
selftable()
public
static table(string $table) : self
Parameters
- $table : string
Internal
for the voters of TYPO3 Core, check a TcaSchema instead
Return values
selfwidget()
public
static widget(string $identifier) : self
Parameters
- $identifier : string
Internal
for the voters of TYPO3 Core, check a WidgetConfigurationInterface instead