show only authorized projects
This commit is contained in:
parent
7d2343fc4d
commit
0fad9cf1d2
8 changed files with 152 additions and 31 deletions
|
|
@ -20,7 +20,9 @@ return [
|
|||
'page' => $page,
|
||||
'parentId' => $data->parentId,
|
||||
'file' => $file,
|
||||
'filePageIndex' => $data->filePageIndex,
|
||||
'position' => [
|
||||
'pageIndex' => $data->position->pageIndex,
|
||||
],
|
||||
'text' => $data->text,
|
||||
'author' => $user,
|
||||
'date' => (string) $data->date,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
$children = $page->children()->map(function ($child) {
|
||||
$children = $page->children()->filter(function ($child) {
|
||||
return kirby()->user()->role() === 'admin' || $child->managers()->toUsers()->has(kirby()->user());
|
||||
})->map(function ($child) {
|
||||
return [
|
||||
'title' => $child->title()->value(),
|
||||
'url' => $child->url(),
|
||||
'uri' => $child->uri(),
|
||||
'uri' => '/' . $child->uri(),
|
||||
'modified' => $child->modified('Y-MM-d'),
|
||||
'currentStep' => $child->currentStep()->value(),
|
||||
|
|
@ -12,6 +13,7 @@ $children = $page->children()->map(function ($child) {
|
|||
];
|
||||
})->values();
|
||||
|
||||
|
||||
$specificData = [
|
||||
"children" => $children,
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue