Access
class Access
Class that handles all access authorisation routines.
Methods
Method for clearing static caches.
Method to check if a user is authorised to perform an action, optionally on an asset.
Method to preload the Rules object for the given asset type.
Method to check if a group is authorised to perform an action, optionally on an asset.
Method to return the Rules object for an asset. The returned object can optionally hold only the rules explicitly set for the asset or the summation of all inherited rules from parent assets and explicit rules.
Method to get the extension name from the asset name.
Method to get the asset type from the asset name.
Method to return the title of a user group
Method to return a list of user groups mapped to a user. The returned list can optionally hold only the groups explicitly mapped to the user or all groups both explicitly mapped and inherited by the user.
Method to return a list of user Ids contained in a Group
Method to return a list of view levels for which the user is authorised.
Method to return a list of actions for which permissions can be set given a component and section.
Method to return a list of actions from a file for which permissions can be set.
Method to return a list of actions from a string or from an xml for which permissions can be set.
Details
static
boolean|null
check(
integer $userId,
string $action,
integer|string $assetKey = null,
boolean $preload = true)
Method to check if a user is authorised to perform an action, optionally on an asset.
static
boolean
preload(
integer|string|array $assetTypes = 'components',
boolean $reload = false)
Method to preload the Rules object for the given asset type.
static
boolean
checkGroup(
integer $groupId,
string $action,
integer|string $assetKey = null,
boolean $preload = true)
Method to check if a group is authorised to perform an action, optionally on an asset.
static
Rules
getAssetRules(
integer|string $assetKey,
boolean $recursive = false,
boolean $recursiveParentAsset = true,
boolean $preload = true)
Method to return the Rules object for an asset. The returned object can optionally hold only the rules explicitly set for the asset or the summation of all inherited rules from parent assets and explicit rules.
static
string
getExtensionNameFromAsset(
integer|string $assetKey)
Method to get the extension name from the asset name.
static
string
getAssetType(
integer|string $assetKey)
Method to get the asset type from the asset name.
For top level components this returns "components": 'com_content' returns 'components'
For other types: 'comcontent.article.1' returns 'comcontent.article' 'comcontent.category.1' returns 'comcontent.category'
static
array
getGroupsByUser(
integer $userId,
boolean $recursive = true)
Method to return a list of user groups mapped to a user. The returned list can optionally hold only the groups explicitly mapped to the user or all groups both explicitly mapped and inherited by the user.
static
array
getUsersByGroup(
integer $groupId,
boolean $recursive = false)
Method to return a list of user Ids contained in a Group
static
array
getAuthorisedViewLevels(
integer $userId)
Method to return a list of view levels for which the user is authorised.
static
array
getActions(
string $component,
string $section = 'component')
Method to return a list of actions for which permissions can be set given a component and section.
static
boolean|array
getActionsFromFile(
string $file,
string $xpath = '/access/section[@name=\'component\']/')
Method to return a list of actions from a file for which permissions can be set.
static
boolean|array
getActionsFromData(
string|SimpleXMLElement $data,
string $xpath = '/access/section[@name=\'component\']/')
Method to return a list of actions from a string or from an xml for which permissions can be set.