Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 403 forbidden #56

Open
LarryBarker opened this issue Sep 13, 2024 · 5 comments
Open

[Bug]: 403 forbidden #56

LarryBarker opened this issue Sep 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@LarryBarker
Copy link

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 LarryBarker added the bug Something isn't working label Sep 13, 2024
@lukas-frey
Copy link
Contributor

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

@giagara
Copy link

giagara commented Dec 4, 2024

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

@lukas-frey
Copy link
Contributor

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.

@giagara
Copy link

giagara commented Dec 4, 2024

@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
Copy link

giagara commented Dec 4, 2024

@lukas-frey consider adding this to the readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants