F
Filamentβ€’11mo ago
Ahmad

How can i manage authorization for a custom page (not attached to resource)?

How can i manage authorization for a custom page (not attached to resource)? I have tried to use canAccess function, but that didn't work.
8 Replies
Lara Zeus
Lara Zeusβ€’11mo ago
canView()?
Ahmad
AhmadOPβ€’11mo ago
didn't work either .
Lara Zeus
Lara Zeusβ€’11mo ago
are you extending Filament\Pages\Page? this worked for me the page is hidden
public static function canAccess(): bool
{
return false;
}
public static function canAccess(): bool
{
return false;
}
Ahmad
AhmadOPβ€’11mo ago
Yeah, i'm extending Filament\Pages\Page but it's not working i just double checked. I went up the hierarchy to see where this function is called "canAccess" and i can't find it being called anywhere. Which version of Filament are you using? I have v3.1.11 on my side
Lara Zeus
Lara Zeusβ€’11mo ago
i am in last version of 3.2 and I think this one exist from older versions do you have any other ploiceis can be effecting this!
Ahmad
AhmadOPβ€’11mo ago
nope, this is a custom settings page that I have which is not tied to any resource (Model), so policies should not affect that.
Lara Zeus
Lara Zeusβ€’11mo ago
i am really out of ideas πŸ™‚
Ahmad
AhmadOPβ€’11mo ago
it turns out i had to update to 3.2 for that to work πŸ™‚ Thanks a lot for looking into it! πŸ™‚
Want results from more Discord servers?
Add your server