Skip to content
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
71120eb
Add permission
aerni Jun 12, 2025
39950db
Restrict other authors from viewing entries
aerni Jun 12, 2025
91b22dd
Only show author’s entries in listings
aerni Jun 12, 2025
0544e44
Fix entries count
aerni Jun 12, 2025
9aa2719
Make Erin happy with shorter syntax
aerni Jun 13, 2025
ba02dce
Handle entries fieldtype
aerni Jun 13, 2025
9fd7f56
Handle tree view
aerni Jun 13, 2025
3fade8b
🍺
aerni Jun 13, 2025
6f7b790
Move filtering to the controller
aerni Jun 13, 2025
24d5892
Fix issue with multiple collections
aerni Jun 13, 2025
3006d6f
Dynamically change author field visibility
aerni Jun 13, 2025
e114128
Also remove author column
aerni Jun 13, 2025
8b3c4f2
Fix tests
aerni Jun 25, 2025
38090d5
Add update script
aerni Jun 25, 2025
f718e21
Add support for multiple authors
aerni Jun 27, 2025
fe47c01
Abstract
aerni Jun 27, 2025
2cddf2a
Fix tests
aerni Jun 27, 2025
475dbdd
Add tests
aerni Jun 27, 2025
6e53818
Allow users to override field visibility
aerni Aug 5, 2025
a5f0cea
Register event listener
aerni Aug 5, 2025
7d9bc30
Make sure permissions apply to search
aerni Aug 20, 2025
773efd6
Merge remote-tracking branch 'statamic/5.x' into feature/view-other-a…
aerni Jan 12, 2026
50f3233
Compare against string
aerni Jan 12, 2026
75d76d0
Use new whereHas
aerni Jan 12, 2026
6e732e2
Fix issue if there are no blueprints with author
aerni Jan 12, 2026
1439cdc
Fix test
aerni Jan 12, 2026
3674ed5
No need to add queries if there is no author field
aerni Jan 12, 2026
aa96198
Make it more readable
aerni Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Fieldtypes/Entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ public function getIndexItems($request)
$query->whereIn('blueprint', $blueprints);
}

collect($this->getConfiguredCollections())
->map(fn ($handle) => Collection::findByHandle($handle))
->filter(fn ($collection) => User::current()->cant('view-other-authors-entries', [EntryContract::class, $collection]))
->each(function ($collection) use ($query) {
$blueprintsWithoutAuthor = $collection->entryBlueprints()
->filter(fn ($blueprint) => ! $blueprint->hasField('author'))
->map->handle()->all();

$query->where(fn ($query) => $query
->whereIn('blueprint', $blueprintsWithoutAuthor)
->orWhere('author', User::current()->id())
);
});

$this->activeFilterBadges = $this->queryFilters($query, $filters, $this->getSelectionFilterContext());

if ($sort = $this->getSortColumn($request)) {
Expand Down