mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
approving news items
This commit is contained in:
@@ -33,19 +33,7 @@ class ArticleOverview extends Component
|
||||
'tags',
|
||||
])
|
||||
->where('type', 'markdown_article')
|
||||
->when(app()->environment('production'),
|
||||
function ($query) {
|
||||
if (auth()->user() && auth()
|
||||
->user()
|
||||
->hasRole('news-editor')) {
|
||||
return;
|
||||
}
|
||||
$query
|
||||
->whereHas('createdBy.roles',
|
||||
fn($query) => $query->where('roles.name', 'news-editor'))
|
||||
->where('approved', true);
|
||||
}
|
||||
)
|
||||
->where('news', true)
|
||||
->orderByDesc('created_at')
|
||||
->get(),
|
||||
])->layout('layouts.app', [
|
||||
|
||||
Reference in New Issue
Block a user