src/Policies/PagePolicy.php
public function view(User $user, Page $page)
    {

        if ($user->canDo('page.page.view')) {
            return true;
        }

        return $user->id == $page->user_id;
    }
public function view(User $user, Page $page)
    {

        if ($user->canDo('page.page.view')) {
            return true;
        }

        return $user->id == $page->user_id;
    }
public function view ( User $ user , Page $ page ) { if ( $ user -> canDo ( 'page.page.view' ) ) { return true ; } return $ user -> id == $ page -> user_id ; }
Determine if the given user can view the page.

@param User $user
@param Page $page

@return bool
Determine if the given user can view the page .