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

AbstractAclAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkPreconditions() 0 7 3
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