Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static | clearStatics () |
static | check ($userId, $action, $assetKey=null, $preload=true) |
static | preload ($assetTypes='components', $reload=false) |
static | checkGroup ($groupId, $action, $assetKey=null, $preload=true) |
static | getAssetRules ($assetKey, $recursive=false, $recursiveParentAsset=true, $preload=true) |
static | getExtensionNameFromAsset ($assetKey) |
static | getAssetType ($assetKey) |
static | getGroupTitle ($groupId) |
static | getGroupsByUser ($userId, $recursive=true) |
static | getUsersByGroup ($groupId, $recursive=false) |
static | getAuthorisedViewLevels ($userId) |
static | getActionsFromFile ($file, $xpath="/access/section[@name='component']/") |
static | getActionsFromData ($data, $xpath="/access/section[@name='component']/") |
Fonctions membres protégées statiques | |
static | getAssetAncestors ($assetType, $assetId) |
static | preloadPermissions ($assetType, $reload=false) |
static | preloadComponents () |
static | getGroupPath ($groupId) |
static | cleanAssetKey ($assetKey=null) |
static | getAssetId ($assetKey) |
static | getAssetName ($assetKey) |
Attributs protégés statiques | |
static | $viewLevels = array() |
static | $assetRules = array() |
static | $assetRulesIdentities = array() |
static | $assetPermissionsParentIdMapping = array() |
static | $preloadedAssetTypes = array() |
static | $identities = array() |
static | $userGroups = array() |
static | $userGroupPaths = array() |
static | $groupsByUser = array() |
static | $preloadedAssets = array() |
static | $rootAssetId = null |
Class that handles all access authorisation routines.
Method to check if a user is authorised to perform an action, optionally on an asset.
integer | $userId | Id of the user for which to check authorisation. |
string | $action | The name of the action to authorise. |
integer | string | $assetKey | The asset key (asset id or asset name). null fallback to root asset. |
boolean | $preload | Indicates whether preloading should be used. |
Références $userId.
Référencé par UserModel\activate(), UserController\allowEdit(), User\authorise(), UserModel\block(), UserModel\delete(), et User\save().
Method to check if a group is authorised to perform an action, optionally on an asset.
integer | $groupId | The path to the group for which to check authorisation. |
string | $action | The name of the action to authorise. |
integer | string | $assetKey | The asset key (asset id or asset name). null fallback to root asset. |
boolean | $preload | Indicates whether preloading should be used. |
Référencé par GroupController\allowEdit(), LevelController\allowEdit(), UserModel\batchUser(), LevelModel\canDelete(), UserHelper\checkSuperUserInUsers(), GroupModel\delete(), DeleteUserCommand\doExecute(), RemoveUserFromGroupCommand\doExecute(), UserMessagesField\getGroups(), DebuggroupModel\getItems(), GroupparentField\getOptions(), UsergrouplistField\getOptions(), User\groups(), GroupModel\save(), ComponentModel\save(), UserModel\save(), User\save(), et LevelModel\validate().
|
staticprotected |
Method to clean the asset key to make sure we always have something.
integer | string | $assetKey | The asset key (asset id or asset name). null fallback to root asset. |
Références Factory\getDbo(), et null.
|
static |
Method for clearing static caches.
Références null.
Référencé par User\clearAccessRights().
|
static |
Method to return a list of actions from a string or from an xml for which permissions can be set.
string | \SimpleXMLElement | $data | The XML string or an XML element. |
string | $xpath | An optional xpath to search for the fields. |
|
static |
Method to return a list of actions from a file for which permissions can be set.
string | $file | The path to the XML file. |
string | $xpath | An optional xpath to search for the fields. |
Références $xml.
Référencé par ContentHelper\getActions(), DebugHelper\getDebugActions(), RulesRule\getFieldActions(), RulesField\getInput(), ComponentsFieldsField\getOptions(), ComponentsWorkflowField\getOptions(), et ComponentsFieldgroupField\getOptions().
|
staticprotected |
Method to recursively retrieve the list of parent Asset IDs for a particular Asset.
string | $assetType | The asset type, or the asset name, or the extension of the asset (e.g. 'com_content.article', 'com_menus.menu.2', 'com_contact'). |
integer | $assetId | The numeric asset id. |
|
staticprotected |
Method to get the asset id from the asset key.
integer | string | $assetKey | The asset key (asset id or asset name). |
Références Factory\getDbo(), et null.
|
staticprotected |
Method to get the asset name from the asset key.
integer | string | $assetKey | The asset key (asset id or asset name). |
Références elseif, Factory\getDbo(), et null.
|
static |
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.
integer | string | $assetKey | The asset key (asset id or asset name). null fallback to root asset. |
boolean | $recursive | True to return the rules object with inherited rules. |
boolean | $recursiveParentAsset | True to calculate the rule also based on inherited component/extension rules. |
boolean | $preload | Indicates whether preloading should be used. |
Hashing the collected rules allows us to store only one instance of the Rules object for Assets that have the same exact permissions... it's a great way to save some memory.
Références $assetId, $db, $hash, $id, $query, $result, Log\add(), Factory\getDbo(), Profiler\getInstance(), Log\INFO, ParameterType\INTEGER, JDEBUG, name, null, et Log\WARNING.
Référencé par User\authorise(), RulesField\getInput(), et GroupModel\save().
|
static |
Method to get the asset type from the asset name.
For top level components this returns "components": 'com_content' returns 'components'
For other types: 'com_content.article.1' returns 'com_content.article' 'com_content.category.1' returns 'com_content.category'
integer | string | $assetKey | The asset key (asset id or asset name). |
|
static |
Method to return a list of view levels for which the user is authorised.
integer | $userId | Id of the user for which to get the list of authorised view levels. |
Références $authorised, $db, $groups, $id, $query, $user, $userId, elseif, Factory\getApplication(), Factory\getDbo(), et User\getInstance().
Référencé par User\getAuthorisedViewLevels(), ArticlesPopularHelper\getList(), et ArticlesCategoryHelper\getList().
|
static |
Method to get the extension name from the asset name.
integer | string | $assetKey | The asset key (asset id or asset name). |
|
staticprotected |
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).
mixed | $groupId | An integer or array of integers representing the identities to check. |
Références $groups, et UserGroupsHelper\getInstance().
|
static |
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.
integer | $userId | Id of the user for which to get the list of groups. |
boolean | $recursive | True to include inherited user groups. |
Références $db, $query, $result, $userId, Factory\getDbo(), ComponentHelper\getParams(), ParameterType\INTEGER, et ArrayHelper\toInteger().
Référencé par GroupModel\delete(), RemoveUserFromGroupCommand\doExecute(), ComponentHelper\filterText(), User\getAuthorisedGroups(), AddUserToGroupCommand\getGroups(), RemoveUserFromGroupCommand\getGroups(), GroupModel\save(), ProfileModel\save(), et ApplicationModel\save().
|
static |
Method to return the title of a user group
integer | $groupId | Id of the group for which to get the title of. |
Références $db, $query, Factory\getDbo(), et ParameterType\INTEGER.
|
static |
Method to return a list of user Ids contained in a Group
integer | $groupId | The group Id |
boolean | $recursive | Recursively include all child groups (optional) |
Références $db, $query, $result, Factory\getDbo(), ParameterType\INTEGER, et ArrayHelper\toInteger().
|
static |
Method to preload the Rules object for the given asset type.
integer | string | array | $assetTypes | The type or name of the asset (e.g. 'com_content.article', 'com_menus.menu.2'). Also accepts the asset id. An array of asset type or a special 'components' string to load all component assets. |
boolean | $reload | Set to true to reload from database. |
|
staticprotected |
Method to preload the Rules objects for all components.
Note: This will only get the base permissions for the component. e.g. it will get 'com_content', but not 'com_content.article.1' or any more specific asset type rules.
Références $component, $db, $query, ComponentHelper\getComponents(), Factory\getDbo(), Profiler\getInstance(), JDEBUG, null, et ParameterType\STRING.
|
staticprotected |
Method to retrieve the Asset Rule strings for this particular Asset Type and stores them for later usage in getAssetRules(). Stores 2 arrays: one where the list has the Asset ID as the key and a second one where the Asset Name is the key.
string | $assetType | The asset type, or the asset name, or the extension of the asset (e.g. 'com_content.article', 'com_menus.menu.2', 'com_contact'). |
boolean | $reload | Reload the preloaded assets. |
Références $db, $query, Factory\getDbo(), Profiler\getInstance(), et JDEBUG.
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |