| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JController |
setAccessControl |
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.
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. |
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.