code: public function hasPermission($permission)
      {   
          $permission = Permission::whereName($permission)->first();
          if (is_null($permission)){
              return false;
          }
          return $this->hasRole($permission->roles);
      }
docs: Determine if the user may perform the given permission.
  
  @param  Permission $permission
  @return boolean