Reine Redaktionsrechte öffnen nicht mehr das Backend (0.25.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m6s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m20s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m17s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m44s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m51s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m6s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m20s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m17s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m44s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m51s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4d155457b8
commit
34d6cdbf1c
121 changed files with 371 additions and 318 deletions
|
|
@ -9,6 +9,7 @@ defineProps({
|
|||
review: { type: Array, required: true },
|
||||
mine: { type: Array, required: true },
|
||||
scheduled: { type: Array, required: true },
|
||||
published: { type: Array, default: () => [] },
|
||||
canCreate: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
|
|
@ -30,6 +31,7 @@ const badge = (post) => ({
|
|||
{ key: 'review', title: 'Zur Freigabe', items: review, empty: null },
|
||||
{ key: 'mine', title: 'Meine Entwürfe', items: mine, empty: 'Keine offenen Entwürfe.' },
|
||||
{ key: 'scheduled', title: 'Geplant', items: scheduled, empty: null },
|
||||
{ key: 'published', title: 'Zuletzt veröffentlicht', items: published, empty: null },
|
||||
].filter((g) => g.items.length || g.empty)" :key="group.key">
|
||||
<h3 class="mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase">
|
||||
{{ group.title }}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,16 @@ final class EditorialNews
|
|||
->whereKeyNot($mine->modelKeys())
|
||||
->oldest('published_at')->limit(20)->get();
|
||||
|
||||
// Zuletzt veröffentlicht – zum Nachbessern, ohne das Backend zu brauchen
|
||||
$published = $writable === [] ? collect() : NewsPost::query()->with(['category', 'author'])
|
||||
->published()
|
||||
->when($writable !== true, fn ($q) => $q->whereIn('category_id', $writable))
|
||||
->latest('published_at')->limit(15)->get()
|
||||
->filter(fn (NewsPost $post) => $user->can('update', $post));
|
||||
|
||||
return [
|
||||
'review' => $review->map($map)->all(),
|
||||
'published' => $published->map($map)->values()->all(),
|
||||
'mine' => $mine->map($map)->all(),
|
||||
'scheduled' => $scheduled->map($map)->all(),
|
||||
'canCreate' => app(Policies\NewsPostPolicy::class)->create($user),
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ class NewsPlugin extends Plugin
|
|||
|
||||
$abilities = $this->app->make(Abilities::class);
|
||||
$abilities->define('news.manage', 'Neuigkeiten: alle Kategorien verwalten', 'Neuigkeiten');
|
||||
$abilities->define('news.post.create', 'Beiträge schreiben', 'Neuigkeiten', resource: 'news_category');
|
||||
$abilities->define('news.post.publish', 'Beiträge veröffentlichen', 'Neuigkeiten', resource: 'news_category');
|
||||
$abilities->define('news.comments.moderate', 'Kommentare anderer löschen', 'Neuigkeiten');
|
||||
$abilities->define('news.post.create', 'Beiträge schreiben', 'Neuigkeiten', resource: 'news_category', portal: true);
|
||||
$abilities->define('news.post.publish', 'Beiträge veröffentlichen', 'Neuigkeiten', resource: 'news_category', portal: true);
|
||||
$abilities->define('news.comments.moderate', 'Kommentare anderer löschen', 'Neuigkeiten', portal: true);
|
||||
$abilities->resourceType('news_category', 'Kategorie', fn () => NewsCategory::query()->orderBy('sort')->pluck('name', 'id')->all());
|
||||
|
||||
Gate::policy(NewsCategory::class, NewsCategoryPolicy::class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue