ResourceIdentifier

final readonly class \TYPO3\CMS\Core\Security\Authorization\Policy\ResourceIdentifier

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.

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_VALUE

public string FIELD_VALUE = 'field_value'

LANGUAGE

public string LANGUAGE = 'language'

MFA_PROVIDER

public string MFA_PROVIDER = 'mfa_provider'

PAGE_TYPE

public string PAGE_TYPE = 'page_type'

Properties

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

Return values

self

customOption()

public static customOption(string $identifier) : self

Parameters

$identifier : string

the option as "group:item"

Return values

self

field()

public static field(string $table, string $field) : self

Parameters

$table : string
$field : string

Return values

self

fieldValue()

public static fieldValue(string $table, string $field, string $value) : self

Parameters

$table : string
$field : string
$value : string

Return values

self

language()

A language without a site, see the LanguageVoter

public static language(int $languageId) : self

Parameters

$languageId : int

Return values

self

mfaProvider()

public static mfaProvider(string $identifier) : self

Parameters

$identifier : string

Return values

self

module()

public static module(string $identifier) : self

Parameters

$identifier : string

Return values

self

pageType()

public static pageType(int $doktype) : self

Parameters

$doktype : int

Return values

self

table()

public static table(string $table) : self

Parameters

$table : string

Return values

self

widget()

public static widget(string $identifier) : self

Parameters

$identifier : string

Return values

self
On this page