Access
Wrapper class for Access
since |
3.4 |
---|---|
deprecated |
4.0 Use |
Methods
check
Helper wrapper method for check
check(integer $userId, string $action, mixed $asset = null) : boolean
see | \Joomla\CMS\Access\Access::check() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $userId
integer
Id of the user for which to check authorisation.- $action
string
The name of the action to authorise.- $asset
mixed
Integer asset id or the name of the asset as a string. Defaults to the global asset node.
Response
boolean
True if authorised.
checkGroup
Helper wrapper method for checkGroup
checkGroup(integer $groupId, string $action, mixed $asset = null) : boolean
see | \Joomla\CMS\Access\Access::checkGroup() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $groupId
integer
The path to the group for which to check authorisation.- $action
string
The name of the action to authorise.- $asset
mixed
Integer asset id or the name of the asset as a string. Defaults to the global asset node.
Response
boolean
True if authorised.
clearStatics
Helper wrapper method for addUserToGroup
clearStatics() : void
see | \Joomla\CMS\Access\Access::clearStatics |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
getActions
Helper wrapper method for getActions
getActions(string $component, string $section = 'component') : array
see | \Joomla\CMS\Access\Access::getActions() |
---|---|
since |
3.4 |
deprecated |
4.0 Use StaticAccess::getActionsFromFile or StaticAccess::getActionsFromData instead. |
Arguments
- $component
string
The component from which to retrieve the actions.- $section
string
The name of the section within the component from which to retrieve the actions.
Response
array
List 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 | \Joomla\CMS\Access\Access::getActionsFromData() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $data
string|\SimpleXMLElement
The XML string or an XML element.- $xpath
string
An optional xpath to search for the fields.
Response
boolean|array
False 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 | \Joomla\CMS\Access\Access::getActionsFromFile() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $file
string
The path to the XML file.- $xpath
string
An optional xpath to search for the fields.
Response
boolean|array
False 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
see | \Joomla\CMS\Access\Access::getAssetRules |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $asset
mixed
Integer asset id or the name of the asset as a string.- $recursive
boolean
True to return the rules object with inherited rules.
Response
\Joomla\CMS\Access\Rules
AccessRules object for the asset.
getAuthorisedViewLevels
Helper wrapper method for getAuthorisedViewLevels
getAuthorisedViewLevels(integer $userId) : array
see | \Joomla\CMS\Access\Access::getAuthorisedViewLevels() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $userId
integer
Id of the user for which to get the list of authorised view levels.
Response
array
List of view levels for which the user is authorised.
getGroupsByUser
Helper wrapper method for getGroupsByUser
getGroupsByUser(integer $userId, boolean $recursive = true) : array
see | \Joomla\CMS\Access\Access::getGroupsByUser() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $userId
integer
Id of the user for which to get the list of groups.- $recursive
boolean
True to include inherited user groups.
Response
array
List of user group ids to which the user is mapped.
getUsersByGroup
Helper wrapper method for getUsersByGroup
getUsersByGroup(integer $groupId, boolean $recursive = false) : array
see | \Joomla\CMS\Access\Access::getUsersByGroup() |
---|---|
since |
3.4 |
deprecated |
4.0 Use |
Arguments
- $groupId
integer
The group Id- $recursive
boolean
Recursively include all child groups (optional)
Response
array