diff --git a/library/Feeds/ProvidedHook/Csp.php b/library/Feeds/ProvidedHook/Csp.php index b93d81d..495a2a0 100644 --- a/library/Feeds/ProvidedHook/Csp.php +++ b/library/Feeds/ProvidedHook/Csp.php @@ -3,7 +3,6 @@ namespace Icinga\Module\Feeds\ProvidedHook; use Icinga\Application\Hook\CspHook; -use Icinga\Authentication\Auth; use Icinga\Module\Feeds\Storage\StorageFactory; use Icinga\User; use ipl\Web\Common\Csp as CspInstance; @@ -32,7 +31,7 @@ public function getCspForAllUsers(): CspInstance public function getCspForUser(User $user): CspInstance { - if (Auth::getInstance()->hasPermission('feeds/view')) { + if ($user->can('feeds/view')) { return $this->getCspForAllUsers(); }