about summary refs log tree commit diff stats
path: root/wiki/inc/Action/AbstractAclAction.php
diff options
context:
space:
mode:
Diffstat (limited to 'wiki/inc/Action/AbstractAclAction.php')
-rw-r--r--wiki/inc/Action/AbstractAclAction.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/wiki/inc/Action/AbstractAclAction.php b/wiki/inc/Action/AbstractAclAction.php
new file mode 100644
index 0000000..871edb0
--- /dev/null
+++ b/wiki/inc/Action/AbstractAclAction.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace dokuwiki\Action;
+
+use dokuwiki\Action\Exception\ActionAclRequiredException;
+
+/**
+ * Class AbstractAclAction
+ *
+ * An action that requires the ACL subsystem to be enabled (eg. useacl=1)
+ *
+ * @package dokuwiki\Action
+ */
+abstract class AbstractAclAction extends AbstractAction {
+
+    /** @inheritdoc */
+    public function checkPreconditions() {
+        parent::checkPreconditions();
+        global $conf;
+        global $auth;
+        if(!$conf['useacl']) throw new ActionAclRequiredException();
+        if(!$auth) throw new ActionAclRequiredException();
+    }
+
+}