Skip to content

Commit de264b6

Browse files
committed
global resource shows all records
1 parent 999be24 commit de264b6

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

packages/core/src/Support/Resources/ScopedResourceContext.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,9 @@ public static function applyScope(Builder $query, string $resource): Builder
8383
$scope = static::getParsedScope($resource);
8484

8585
if ($scope === null) {
86-
if (! static::supportsScopeColumn($query->getModel()::class)) {
87-
return $query;
88-
}
89-
90-
// Global view: show only global records (empty scope).
91-
$scopeColumn = $query->getModel()->qualifyColumn('scope');
92-
93-
return $query->where(function (Builder $builder) use ($scopeColumn): void {
94-
$builder->whereNull($scopeColumn)->orWhere($scopeColumn, '');
95-
});
86+
// Global view (no scoped resource context): do not restrict by scope.
87+
// This means global resources show both unassigned and scoped records.
88+
return $query;
9689
}
9790

9891
if (! static::supportsScopeColumn($query->getModel()::class)) {

0 commit comments

Comments
 (0)