Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleIs my plugin required to use the ACL?

Your plugin is not required to use the ACL, but it's a good idea. Using the ACL allows users who install your plugin finer grained control over where your plugin can appear and who can use it.

Enforcing the ACL

Every controller that inherits from AppController (either directly or indirectly) can enforce the ACL rules on the requested resource simply by invoking the requireLogin() method.

Code Block
languagephp
title/plugins/my_plugin/controllers/client_main.php
firstline1
linenumberstrue
<?php
class ClientMain extends MyPluginController {
    public function preAction() {
        parent::preAction();
 
        // Login required
		$this->requireLogin();
	}
	
	public function index() {
		// Automatically protected by the ACL
	}
}
?>