public function view(UserPolicy $user, News $news)
    {
        if ($user->canDo('news.news.view') && $user->isAdmin()) {
            return true;
        }

        return $news->user_id == user_id() && $news->user_type == user_type();
    }
public function view(UserPolicy $user, News $news)
    {
        if ($user->canDo('news.news.view') && $user->isAdmin()) {
            return true;
        }

        return $news->user_id == user_id() && $news->user_type == user_type();
    }
public function view ( UserPolicy $ user , News $ news ) { if ( $ user -> canDo ( 'news.news.view' ) && $ user -> isAdmin ( ) ) { return true ; } return $ news -> user_id == user_id ( ) && $ news -> user_type == user_type ( ) ; }
Determine if the given user can view the news.

@param UserPolicy $user
@param News $news

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