1 <?php
2 
3 namespace dokuwiki\Action;
4 
5 use dokuwiki\Action\Exception\ActionAclRequiredException;
6 use dokuwiki\Extension\AuthPlugin;
7 
8 /**
9  * Class AbstractAclAction
10  *
11  * An action that requires the ACL subsystem to be enabled (eg. useacl=1)
12  *
13  * @package dokuwiki\Action
14  */
15 abstract class AbstractAclAction extends AbstractAction
16 {
17     /** @inheritdoc */
18     public function checkPreconditions()
19     {
20         parent::checkPreconditions();
21         global $conf;
22         global $auth;
23         if (!$conf['useacl']) throw new ActionAclRequiredException();
24         if (!$auth instanceof AuthPlugin) throw new ActionAclRequiredException();
25     }
26 }
27