JAccessWrapperAccess

Wrapper class for JAccess

package

Joomla.Platform

subpackage

User

since

3.4

Methods

check

Helper wrapper method for check

check(integer $userId, string $action, mixed $asset = null) : boolean
see \JAccess::check()
since

3.4

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
see \JAccess::checkGroup()
since

3.4

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
see \JAccess::clearStatics
since

3.4

getActions

Helper wrapper method for getActions

getActions(string $component, string $section = 'component') : array
see \JAccess::getActions()
since

3.4

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
see \JAccess::getActionsFromData()
since

3.4

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
see \JAccess::getActionsFromFile()
since

3.4

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) : \JAccessRules
see \JAccess::getAssetRules
since

3.4

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

\JAccessRulesJAccessRules object for the asset.

getAuthorisedViewLevels

Helper wrapper method for getAuthorisedViewLevels

getAuthorisedViewLevels(integer $userId) : array
see \JAccess::getAuthorisedViewLevels()
since

3.4

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
see \JAccess::getGroupsByUser()
since

3.4

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
see \JAccess::getUsersByGroup()
since

3.4

Arguments

$groupId

integerThe group Id

$recursive

booleanRecursively include all child groups (optional)

Response

array