As mentioned earlier, I’d need to trigger the redirect every time an editor tries accessing the panel homepage, not only after login. This is because he/she might click on the site name in the panel breadcrumb.
Can anyone think of a way to do this with a route or some other sort of redirect?
I’m already using permissions to prevent access to some panel pages, and will probably end up using this approach.
The outcome is a bit dirtier since the user is prompted an error message when trying to access the forbidden page (e.g. ! The page “options” cannot be found).
Do you also get that if you set options in blueprints like this:
Title: Page hidden for editors
This should actually hide all pages not available to editors even in the Dashboard. The extra site.yml is still the better alternative on top, because you can then create a nicer layout for this special use case.
If you implement the above hints from @texnixe with my link, you can use the default.yml file in the editor blueprint path to create a special error message. The prerequisite would be that for all pages, that the editor should edit, there is a separate *.yml file in his blueprint path.
The file site.yml is his start page in the panel, which can look completely different than e.g. for admins.
You can also hide unwanted entries in the top left menu for the editor, depending on your requirements.
Hm, I have to look into that. That setting shouldn’t be in site.yml, though, but in the blueprints for the parent pages where the user is not allowed to create subpages. Or do you mean, prevent the editors to create first level pages? But that should be solvable by creating different site.yml blueprints for editors and admins.
I tried (A) using two different folders (/site/blueprints/admin/site.yml and /site/blueprints/editor/site.yml) but it gives me an error: Call to a member function options() on null.
If (B) I leave the original /site/blueprints/site.yml (intended for editors) and just change the setting for admin roles to /site/blueprints/admin/site.yml, the original one overwrites the admin one as you predicted.