- return $this->scopeHasPermission($query, 'view');
- }
-
- /**
- * Scope the query to those entities that the current user has the given permission for.
- */
- public function scopeHasPermission(Builder $query, string $permission)
- {
- return Permissions::restrictEntityQuery($query, $permission);