Access

Wrapper class for Access

deprecated
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Methods

check

Helper wrapper method for check

check(integer $userId, string $action, mixed $asset = null) : boolean
deprecated
see \Joomla\CMS\Access\Access::check()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$userId

integerId of the user for which to check authorisation.

$action

stringThe name of the action to authorise.

$asset

mixedInteger asset id or the name of the asset as a string. Defaults to the global asset node.

Response

booleanTrue if authorised.

checkGroup

Helper wrapper method for checkGroup

checkGroup(integer $groupId, string $action, mixed $asset = null) : boolean
deprecated
see \Joomla\CMS\Access\Access::checkGroup()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$groupId

integerThe path to the group for which to check authorisation.

$action

stringThe name of the action to authorise.

$asset

mixedInteger asset id or the name of the asset as a string. Defaults to the global asset node.

Response

booleanTrue if authorised.

clearStatics

Helper wrapper method for addUserToGroup

clearStatics() : void
deprecated
see \Joomla\CMS\Access\Access::clearStatics
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

getActions

Helper wrapper method for getActions

getActions(string $component, string $section = 'component') : array
deprecated
see \Joomla\CMS\Access\Access::getActions()
since

3.4

deprecated

12.3 (Platform) & 4.0 (CMS) Use StaticAccess::getActionsFromFile or StaticAccess::getActionsFromData instead.

Arguments

$component

stringThe component from which to retrieve the actions.

$section

stringThe name of the section within the component from which to retrieve the actions.

Response

arrayList of actions available for the given component and section.

getActionsFromData

Helper wrapper method for getActionsFromData

getActionsFromData(string|\SimpleXMLElement $data, string $xpath = '/access/section[@name=\'component\']/') : boolean|array
deprecated
see \Joomla\CMS\Access\Access::getActionsFromData()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$data

string|\SimpleXMLElementThe XML string or an XML element.

$xpath

stringAn optional xpath to search for the fields.

Response

boolean|arrayFalse if case of error or the list of actions available.

getActionsFromFile

Helper wrapper method for getActionsFromFile

getActionsFromFile(string $file, string $xpath = '/access/section[@name=\'component\']/') : boolean|array
deprecated
see \Joomla\CMS\Access\Access::getActionsFromFile()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$file

stringThe path to the XML file.

$xpath

stringAn optional xpath to search for the fields.

Response

boolean|arrayFalse if case of error or the list of actions available.

getAssetRules

Helper wrapper method for getAssetRules

getAssetRules(mixed $asset, boolean $recursive = false) : \Joomla\CMS\Access\Rules
deprecated
see \Joomla\CMS\Access\Access::getAssetRules
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$asset

mixedInteger asset id or the name of the asset as a string.

$recursive

booleanTrue to return the rules object with inherited rules.

Response

\Joomla\CMS\Access\RulesAccessRules object for the asset.

getAuthorisedViewLevels

Helper wrapper method for getAuthorisedViewLevels

getAuthorisedViewLevels(integer $userId) : array
deprecated
see \Joomla\CMS\Access\Access::getAuthorisedViewLevels()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$userId

integerId of the user for which to get the list of authorised view levels.

Response

arrayList of view levels for which the user is authorised.

getGroupsByUser

Helper wrapper method for getGroupsByUser

getGroupsByUser(integer $userId, boolean $recursive = true) : array
deprecated
see \Joomla\CMS\Access\Access::getGroupsByUser()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$userId

integerId of the user for which to get the list of groups.

$recursive

booleanTrue to include inherited user groups.

Response

arrayList of user group ids to which the user is mapped.

getUsersByGroup

Helper wrapper method for getUsersByGroup

getUsersByGroup(integer $groupId, boolean $recursive = false) : array
deprecated
see \Joomla\CMS\Access\Access::getUsersByGroup()
since

3.4

deprecated

4.0 Use Joomla\CMS\Access\Access directly

Arguments

$groupId

integerThe group Id

$recursive

booleanRecursively include all child groups (optional)

Response

array