JFactory/getACL

From Joomla! Documentation

Jump to: navigation, search

Returns a reference to the global authorisation object, only creating it if it doesn't already exist. In Joomla 1.5 the object returned will be of type JAuthorization, from Joomla 1.6 this will be a JAccess object.

Contents

Description

Get an authorization object

Syntax

static& JFactory::getACL()


Returns

object JACL

Defined in

libraries/joomla/factory.php

Importing

jimport( 'joomla.factory' );

Source Body

        public static function &getACL()
        {
                if (!is_object(JFactory::$acl)) {
                        jimport('joomla.access.access');
 
                        JFactory::$acl = new JAccess();
                }
 
                return JFactory::$acl;
        }

Example

In this example, the global authorisation object is retrieved. TODO: Need a more useful example.

$acl =& JFactory::getACL();

See also

Personal tools