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