class Access

Wrapper class for Access

Methods

void
clearStatics()

Helper wrapper method for addUserToGroup

boolean
check( integer $userId, string $action, mixed $asset = null)

Helper wrapper method for check

boolean
checkGroup( integer $groupId, string $action, mixed $asset = null)

Helper wrapper method for checkGroup

getAssetRules( mixed $asset, boolean $recursive = false)

Helper wrapper method for getAssetRules

array
getGroupsByUser( integer $userId, boolean $recursive = true)

Helper wrapper method for getGroupsByUser

array
getUsersByGroup( integer $groupId, boolean $recursive = false)

Helper wrapper method for getUsersByGroup

array
getAuthorisedViewLevels( integer $userId)

Helper wrapper method for getAuthorisedViewLevels

array
getActions( string $component, string $section = 'component')

Helper wrapper method for getActions

boolean|array
getActionsFromFile( string $file, string $xpath = '/access/section[@name=\'component\']/')

Helper wrapper method for getActionsFromFile

boolean|array
getActionsFromData( string|SimpleXMLElement $data, string $xpath = '/access/section[@name=\'component\']/')

Helper wrapper method for getActionsFromData

Details

void clearStatics()

Helper wrapper method for addUserToGroup

Return Value

void

See also

StaticAccess::clearStatics

boolean check( integer $userId, string $action, mixed $asset = null)

Helper wrapper method for check

Parameters

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.

Return Value

boolean True if authorised.

See also

StaticAccess::check()

boolean checkGroup( integer $groupId, string $action, mixed $asset = null)

Helper wrapper method for checkGroup

Parameters

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.

Return Value

boolean True if authorised.

See also

StaticAccess::checkGroup()

Rules getAssetRules( mixed $asset, boolean $recursive = false)

Helper wrapper method for getAssetRules

Parameters

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.

Return Value

Rules AccessRules object for the asset.

See also

StaticAccess::getAssetRules

array getGroupsByUser( integer $userId, boolean $recursive = true)

Helper wrapper method for getGroupsByUser

Parameters

integer $userId Id of the user for which to get the list of groups.
boolean $recursive True to include inherited user groups.

Return Value

array List of user group ids to which the user is mapped.

See also

StaticAccess::getGroupsByUser()

array getUsersByGroup( integer $groupId, boolean $recursive = false)

Helper wrapper method for getUsersByGroup

Parameters

integer $groupId The group Id
boolean $recursive Recursively include all child groups (optional)

Return Value

array

See also

StaticAccess::getUsersByGroup()

array getAuthorisedViewLevels( integer $userId)

Helper wrapper method for getAuthorisedViewLevels

Parameters

integer $userId Id of the user for which to get the list of authorised view levels.

Return Value

array List of view levels for which the user is authorised.

See also

StaticAccess::getAuthorisedViewLevels()

array getActions( string $component, string $section = 'component')

Helper wrapper method for getActions

Parameters

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.

Return Value

array List of actions available for the given component and section.

See also

StaticAccess::getActions()

boolean|array getActionsFromFile( string $file, string $xpath = '/access/section[@name=\'component\']/')

Helper wrapper method for getActionsFromFile

Parameters

string $file The path to the XML file.
string $xpath An optional xpath to search for the fields.

Return Value

boolean|array False if case of error or the list of actions available.

See also

StaticAccess::getActionsFromFile()

boolean|array getActionsFromData( string|SimpleXMLElement $data, string $xpath = '/access/section[@name=\'component\']/')

Helper wrapper method for getActionsFromData

Parameters

string|SimpleXMLElement $data The XML string or an XML element.
string $xpath An optional xpath to search for the fields.

Return Value

boolean|array False if case of error or the list of actions available.

See also

StaticAccess::getActionsFromData()