Completed
Push — master ( 13ce47...b2c9cd )
by Andreas
10:39 queued 06:48
created

AbstractAclAction::checkPreconditions()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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