Actions

API16

JController/authorize

From Joomla! Documentation

< API16:JController
Revision as of 21:56, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Authorization check

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

authorize($task)
Parameter Name Default Value Description
$task $task The ACO Section Value to check access on

Returns

boolean True if authorized

Defined in

libraries/joomla/application/component/controller.php

Importing

jimport( 'joomla.application.component.controller' );

Source Body

function authorize($task)
{
        // Only do access check if the aco section is set
        if ($this->_acoSection) {
                // If we have a section value set that trumps the passed task ???
                if ($this->_acoSectionValue) {
                        // We have one, so set it and lets do the check
                        $task = $this->_acoSectionValue;
                }
                // Get the JUser object for the current user and return the authorization boolean
                $user = & JFactory::getUser();
                return $user->authorize($this->_acoSection, $task);
        } else {
                // Nothing set, nothing to check... so obviously its ok :)
                return true;
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />