public static \Joomla\CMS\Object\CMSObject
getActions
(mixed $component = '', mixed $section = '', mixed $id = 0)
/**
* Gets a list of the actions that can be performed.
*
* @param string $component The component name.
* @param string $section The access section name.
* @param integer $id The item ID.
*
* @return CMSObject
*
* @since 3.2
*/
public static function getActions($component = '', $section = '', $id = 0)
{
$assetName = $component;
if ($section && $id) {
$assetName .= '.' . $section . '.' . (int) $id;
}
$result = new CMSObject();
$user = Factory::getUser();
$actions = Access::getActionsFromFile(JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml', '/access/section[@name="component"]/');
if ($actions === false) {
Log::add(Text::sprintf('JLIB_ERROR_COMPONENTS_ACL_CONFIGURATION_FILE_MISSING_OR_IMPROPERLY_STRUCTURED', $component), Log::ERROR, 'jerror');
return $result;
}
foreach ($actions as $action) {
$result->set($action->name, $user->authorise($action->name, $assetName));
}
return $result;
}