Class JAccess

Description

Class that handles all access authorisation routines.

  • since: 11.1

Located in /libraries/joomla/access/access.php (line 21)


	
			
Variable Summary
 static array $assetRules
 static array $groupsByUser
 static array $userGroupPaths
 static array $userGroups
 static array $viewLevels
Method Summary
 static boolean check (integer $userId, string $action, [mixed $asset = null])
 static boolean checkGroup (integer $groupId, string $action, [mixed $asset = null])
 static void clearStatics ()
 static array getActions (string $component, [string $section = 'component'])
 static boolean|array getActionsFromData (string|SimpleXMLElement $data, [string $xpath = "/access/section[@name='component']/"])
 static boolean|array getActionsFromFile (string $file, [string $xpath = "/access/section[@name='component']/"])
 static JAccessRules getAssetRules (mixed $asset, [boolean $recursive = false])
 static array getAuthorisedViewLevels (integer $userId)
 static mixed getGroupPath (mixed $groupId)
 static array getGroupsByUser (integer $userId, [boolean $recursive = true])
 static array getUsersByGroup (integer $groupId, [boolean $recursive = false])
Variables
static array $assetRules = array() (line 37)

Array of rules for the asset

  • since: 11.1
  • access: protected
static array $groupsByUser = array() (line 61)

Array of cached groups by user.

  • since: 11.1
  • access: protected
static array $userGroupPaths = array() (line 53)

Array of user group paths.

  • since: 11.1
  • access: protected
static array $userGroups = array() (line 45)

Array of user groups.

  • since: 11.1
  • access: protected
static array $viewLevels = array() (line 29)

Array of view levels

  • since: 11.1
  • access: protected
Methods
static check (line 90)

Method to check if a user is authorised to perform an action, optionally on an asset.

  • return: True if authorised.
  • since: 11.1
  • access: public
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.
static checkGroup (line 131)

Method to check if a group is authorised to perform an action, optionally on an asset.

  • return: True if authorised.
  • since: 11.1
  • access: public
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.
static clearStatics (line 70)

Method for clearing static caches.

  • since: 11.3
  • access: public
static void clearStatics ()
static getActions (line 465)

Method to return a list of actions for which permissions can be set given a component and section.

  • return: List of actions available for the given component and section.
  • deprecated: 12.3 (Platform) & 4.0 (CMS) Use JAccess::getActionsFromFile or JAccess::getActionsFromData instead.
  • since: 11.1
  • access: public
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.
static getActionsFromData (line 520)

Method to return a list of actions from a string or from an xml for which permissions can be set.

  • return: False if case of error or the list of actions available.
  • since: 12.1
  • access: public
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.
static getActionsFromFile (line 494)

Method to return a list of actions from a file for which permissions can be set.

  • return: False if case of error or the list of actions available.
  • since: 12.1
  • access: public
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.
static getAssetRules (line 218)

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.

  • return: JAccessRules object for the asset.
  • since: 11.1
  • access: public
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.
static getAuthorisedViewLevels (line 402)

Method to return a list of view levels for which the user is authorised.

  • return: List of view levels for which the user is authorised.
  • since: 11.1
  • access: public
static array getAuthorisedViewLevels (integer $userId)
  • integer $userId: Id of the user for which to get the list of authorised view levels.
static getGroupPath (line 169)

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).

  • return: True if allowed, false for an explicit deny, null for an implicit deny.
  • since: 11.1
  • access: protected
static mixed getGroupPath (mixed $groupId)
  • mixed $groupId: An integer or array of integers representing the identities to check.
static getGroupsByUser (line 285)

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.

  • return: List of user group ids to which the user is mapped.
  • since: 11.1
  • access: public
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.
static getUsersByGroup (line 368)

Method to return a list of user Ids contained in a Group

  • todo: This method should move somewhere else
  • since: 11.1
  • access: public
static array getUsersByGroup (integer $groupId, [boolean $recursive = false])
  • integer $groupId: The group Id
  • boolean $recursive: Recursively include all child groups (optional)

Documentation generated on Tue, 19 Nov 2013 14:53:15 +0100 by phpDocumentor 1.4.3