filament-knowledge-base icon indicating copy to clipboard operation
filament-knowledge-base copied to clipboard

[Bug]: 403 forbidden

Open LarryBarker opened this issue 1 year ago • 5 comments

What happened?

Installed according to instructions Registered plugin in panel provider Clicked documentation link image

How to reproduce the bug

Installed according to instructions Registered plugin in panel provider Clicked documentation link

Package Version

guava/filament-knowledge-base (1.10.0)

PHP Version

8.2

Laravel Version

11

Which operating systems does with happen with?

macOS

Notes

No response

LarryBarker avatar Sep 13 '24 03:09 LarryBarker

Hi! Please make sure you enable access to the panel in your canAccessPanel() method in your User model.

lukas-frey avatar Oct 26 '24 11:10 lukas-frey

I have the same issue: just installed and followed the instructions. The user have access to the panel of course because is already logged in

giagara avatar Dec 04 '24 10:12 giagara

I have the same issue: just installed and followed the instructions. The user have access to the panel of course because is already logged in

I'm referring to the documentation panel, not your own panel.

lukas-frey avatar Dec 04 '24 10:12 lukas-frey

@LarryBarker in case you have more than one panel, you have to enable the "knowledge-base" panel:

public function canAccessPanel(Panel $panel): bool
    {
        return match (true) {
            $panel->getId() === 'admin' && $this->role->isAdmin() => true,
-            $panel->getId() === 'app' && $this->role->isUser() => true,
+            $panel->getId() === 'app' || $panel->getId() === 'knowledge-base' && $this->role->isUser() => true,
            default => false,
        };
    }

giagara avatar Dec 04 '24 10:12 giagara

@lukas-frey consider adding this to the readme?

giagara avatar Dec 04 '24 10:12 giagara