xref: /dokuwiki/inc/Action/AbstractAclAction.php (revision b2c9cd19ff3733a632c8d415256d3096765343f7)
164ab5140SAndreas Gohr<?php
264ab5140SAndreas Gohr
364ab5140SAndreas Gohrnamespace dokuwiki\Action;
464ab5140SAndreas Gohr
564ab5140SAndreas Gohruse dokuwiki\Action\Exception\ActionAclRequiredException;
664ab5140SAndreas Gohr
7ab583a1bSAndreas Gohr/**
8ab583a1bSAndreas Gohr * Class AbstractAclAction
9ab583a1bSAndreas Gohr *
10ab583a1bSAndreas Gohr * An action that requires the ACL subsystem to be enabled (eg. useacl=1)
11ab583a1bSAndreas Gohr *
12ab583a1bSAndreas Gohr * @package dokuwiki\Action
13ab583a1bSAndreas Gohr */
1464ab5140SAndreas Gohrabstract class AbstractAclAction extends AbstractAction {
1564ab5140SAndreas Gohr
1664ab5140SAndreas Gohr    /** @inheritdoc */
17*b2c9cd19SAndreas Gohr    public function checkPreconditions() {
18*b2c9cd19SAndreas Gohr        parent::checkPreconditions();
1964ab5140SAndreas Gohr        global $conf;
20480336a3SAndreas Gohr        global $auth;
2164ab5140SAndreas Gohr        if(!$conf['useacl']) throw new ActionAclRequiredException();
22480336a3SAndreas Gohr        if(!$auth) throw new ActionAclRequiredException();
2364ab5140SAndreas Gohr    }
2464ab5140SAndreas Gohr
2564ab5140SAndreas Gohr}
26