AbstractAclAction.php 581 B

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