Method to check if a user is authorised to perform an action, optionally on an asset.
static boolean
check
(integer $userId, string $action, [mixed $asset = null])
-
integer
$userId: Id of the user for which to check authorisation.
-
string
$action: The name of the action to authorise.
-
mixed
$asset: Integer asset id or the name of the asset as a string. Defaults to the global asset node.
Method to check if a group is authorised to perform an action, optionally on an asset.
static boolean
checkGroup
(integer $groupId, string $action, [mixed $asset = null])
-
integer
$groupId: The path to the group for which to check authorisation.
-
string
$action: The name of the action to authorise.
-
mixed
$asset: Integer asset id or the name of the asset as a string. Defaults to the global asset node.
Method for clearing static caches.
static void
clearStatics
()
Method to return a list of actions for which permissions can be set given a component and section.
static array
getActions
(string $component, [string $section = 'component'])
-
string
$component: The component from which to retrieve the actions.
-
string
$section: The name of the section within the component from which to retrieve the actions.
Method to return a list of actions from a string or from an xml for which permissions can be set.
static boolean|array
getActionsFromData
(string|SimpleXMLElement $data, [string $xpath = "/access/section[@name='component']/"])
-
string|SimpleXMLElement
$data: The XML string or an XML element.
-
string
$xpath: An optional xpath to search for the fields.
Method to return a list of actions from a file for which permissions can be set.
static boolean|array
getActionsFromFile
(string $file, [string $xpath = "/access/section[@name='component']/"])
-
string
$file: The path to the XML file.
-
string
$xpath: An optional xpath to search for the fields.
Method to return the JAccessRules 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
JAccessRules
getAssetRules
(
mixed $asset, [
boolean $recursive =
false])
-
mixed
$asset: Integer asset id or the name of the asset as a string.
-
boolean
$recursive: True to return the rules object with inherited rules.
Method to return a list of view levels for which the user is authorised.
static array
getAuthorisedViewLevels
(integer $userId)
-
integer
$userId: Id of the user for which to get the list of authorised view levels.
Gets the parent groups that a leaf group belongs to in its branch back to the root of the tree (including the leaf group id).
static mixed
getGroupPath
(mixed $groupId)
-
mixed
$groupId: An integer or array of integers representing the identities to check.
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
getGroupsByUser
(integer $userId, [boolean $recursive = true])
-
integer
$userId: Id of the user for which to get the list of groups.
-
boolean
$recursive: True to include inherited user groups.
Method to return a list of user Ids contained in a Group
static array
getUsersByGroup
(integer $groupId, [boolean $recursive = false])
-
integer
$groupId: The group Id
-
boolean
$recursive: Recursively include all child groups (optional)