Support Joomla!

references:joomla.framework:application:jcontroller-setaccesscontrol

Table of Contents

setAccessControl

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JController Method setAccessControl Reference setAccessControl() Never Work in Progress

Maps the access control to a section in the ACO.

The specified ACO section generally maps to the component. These settings are used by the authorize() method.

Syntax

void setAccessControl ( $section, $value )

$section string is a string containing the ACO section (eg, the component).
$value string is a string containing the ACO section value (if using a constant value). This parameter is optional and if omitted defaults to null.

Examples

If the following code was inserted into the constructor of the derived controller class:

Example

$this->setAccessControl( 'com_weblinks' );

then

Example

echo ($controller->authorize( 'manage' ) ? 'True' : 'False');

might produce

Result

True

if the current user has manage rights on the com_weblinks controller.


 
references/joomla.framework/application/jcontroller-setaccesscontrol.txt (611 views) · Last modified: 2007/08/15 14:48