Skip to content

Instantly share code, notes, and snippets.

@realityking
Created June 1, 2012 13:45
Show Gist options
  • Save realityking/2852267 to your computer and use it in GitHub Desktop.
Save realityking/2852267 to your computer and use it in GitHub Desktop.
abstract class JAccessHelper
{
public static function getActionsForAsset($asset, $section = 'component')
{
$user = JFactory::getUser();
$result = new JObject;
$actions = JAccess::getActions($asset, $section);
foreach ($actions as $action)
{
$result->set($action->name, $user->authorise($action->name, $asset));
}
return $result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment