API15:JUser/authorize
From Joomla! Documentation
Description
Method to check JUser object authorization against an access control object and optionally an access extension object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
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 );
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples