Custom Page canAccess runs after mount ?

Noticed that canAccess runs after mount. Any way to make it run before. Or not show custom page navigation at all by modifying the route? Not sure how to change a custom pages link. Because they I could pass in the user or another model.
4 Replies
David | Fortune Validator
did you get anywhere with this? Noticing the same. I would also like to access the record within the canAccess but didnt find a way
Dennis Koch
Dennis Koch5mo ago
shouldRegisterNavigation() should be for nav Or similar name
dwiser
dwiser7d ago
Not registering the navigation hides the page from navigation but it doesn't actually prevent access right? That seems like it only hides the problem. For example, I have a link that I have to send to a mailing list of supervisors. That link would approve a submission but can only be approved by a specific supervisor. If every recipient has the link and I have no way to authorize the page for one specific login then there's no actual protection for the page. This is effectively what I'm looking to do: public static function canAccess(): bool { return $this->record->user->manager->uuid === auth()->user()->uuid; }
Dennis Koch
Dennis Koch7d ago
I think you could do authorization in the mount method

Did you find this page helpful?