// Load the Joomla framework define('_JEXEC', 1); define('JPATH_BASE', dirname(__FILE__)); require_once JPATH_BASE.'/includes/defines.php'; require_once JPATH_BASE.'/includes/framework.php'; $application = JFactory::getApplication('site'); // Get the category ID $category_id = 5; // Get the category object $category = JCategories::getInstance('Content')->get($category_id); // Get the ACL object for the category $acl = JFactory::getACL(); $category_acl = $acl->getAssetRules($category->get('rules'));
// Load the Joomla framework define('_JEXEC', 1); define('JPATH_BASE', dirname(__FILE__)); require_once JPATH_BASE.'/includes/defines.php'; require_once JPATH_BASE.'/includes/framework.php'; $application = JFactory::getApplication('site'); // Get the current user object $user = JFactory::getUser(); // Get the ACL object $acl = JFactory::getACL(); // Get the permission to create content $create_permission = $acl->getAssetRules('com_content.article')->create; // Check if the user has permission to create content $can_create = $user->authorise($create_permission); if ($can_create) { echo 'You can create a new article.'; } else { echo 'You do not have permission to create a new article.'; }This code checks if the current user has permission to create a new article in Joomla, based on the ACL object for the com_content.article asset. Package library: Joomla Framework