I have recently tested overriding the isReadable()
method in a page model. To me that seems to be the most effective way at the moment.
Need to go hunting now but will come back to this later.
Edit: I found the example:
class NotePage extends Page
{
public function isReadable(): bool
{
static $readable = [];
$template = $this->intendedTemplate()->name();
if (isset($readable[$template]) === true) {
return $readable[$template];
}
if ($this->author()->toUser() === kirby()->user() || kirby()->user()->role()->name() === 'admin') {
return true;
}
return false;
}
}
Edit 2: There’s also this plugin worth checking out: