Hello,
I'm new to the forum and was wondering how to do the following:
I have created a role for certain users who are only allowed to edit their own pages. I created a module which list only their pages.
public function viewable(HookEvent $event) {
if(!$event->return) return;
$page = $event->object;
if($this->user->name !== $page->createdUser->name && $page->id != 1 && $page->id != 1046) $event->return = false;
}
The superuser sees this:
Home
- Page
--Subpage 01
--Subpage 02
--Subpage 03
--Subpage 04
--Subpage 05
The specific user sees this:
Home
- Page
--Subpage 02
--Subpage 05
This works just fine.
But when I'm logged in as a specific user I still see all the pages in the submenu and can still edit them. I don't want this.
Is it possible to remove all the other pages and only show the pages that the logged in user created?
Is is also possible to remove them from the search results when I'm logged in with specific role?
Thank you in advance.
Alvina