This commit is contained in:
Sven Steinert
2026-05-13 11:57:52 +02:00
parent 6abf6f9c3d
commit f4511b9213
76 changed files with 4494 additions and 1940 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace KbMarkdownImporter\Access;
use KbMarkdownImporter\Plugin;
final class AccessController
{
public function canView(): bool
{
$settings = Plugin::settings();
return '1' === $settings['public_docs'] || is_user_logged_in() || current_user_can('view_kb_docs');
}
public function enforce(): void
{
if ($this->canView()) {
return;
}
auth_redirect();
}
}