API15

API15:JUser/authorize

From Joomla! Documentation

Revision as of 22:17, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to check JUser object authorization against an access control object and optionally an access extension object <span class="editsection" style="font-size:76%;">...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Method to check JUser object authorization against an access control object and optionally an access extension object

[Edit Descripton]

Template:Description:JUser/authorize

Syntax

authorize($acoSection, $aco, $axoSection=null, $axo=null)
Parameter Name Default Value Description
$acoSection $acoSection The ACO section value
$aco $aco The ACO value
$axoSection null $axoSection The AXO section value [optional]
$axo null $axo The AXO value [optional]

Returns

boolean True if authorized

Defined in

libraries/joomla/user/user.php

Importing

jimport( 'joomla.user.user' );

Source Body

function authorize( $acoSection, $aco, $axoSection = null, $axo = null )
{
        // the native calls (Check Mode 1) work on the user id, not the user type
        $acl    = & JFactory::getACL();
        $value  = $acl->getCheckMode() == 1 ? $this->id : $this->usertype;

        return $acl->acl_check( $acoSection, $aco,      'users', $value, $axoSection, $axo );
}

[Edit See Also] Template:SeeAlso:JUser/authorize

Examples

<CodeExamplesForm />