Implement permissions check on blog and blog posts.
This commit is contained in:
@@ -21,4 +21,5 @@ columns:
|
||||
sections:
|
||||
pinned: fields/pinned
|
||||
showOnHome: fields/show-on-home
|
||||
permissionAccess: fields/permission-access
|
||||
dates: fields/dates
|
||||
|
||||
@@ -21,6 +21,7 @@ columns:
|
||||
label: Posts Per Page
|
||||
type: number
|
||||
default: 10
|
||||
permissionAccess: fields/permission-access
|
||||
|
||||
line:
|
||||
type: fields
|
||||
|
||||
@@ -20,6 +20,10 @@ return function ($page) {
|
||||
$posts = $page->children();
|
||||
}
|
||||
|
||||
if (kirby()->plugin("hobbyhome/permissions")) {
|
||||
$posts = $posts->filterBy("hasPerm", true);
|
||||
}
|
||||
|
||||
$posts = $posts->sortBy("pinned", SORT_DESC, "updated", SORT_DESC);
|
||||
|
||||
$posts = $posts->paginate($page->postsPerPage()->toInt());
|
||||
|
||||
Reference in New Issue
Block a user