Jump to content

Template 'home' is used by the homepage and thus must have the 'guest' role


vknt
 Share

Recommended Posts

This is the error I'm getting:

Template 'home' is used by the homepage and thus must have the 'guest' role assigned.

I'm getting why this is so.

However, I like to work on a server online, so my clients can already fill in fields while I'm working on them, so I want to restrict the access to the site for the public but let my clients have access after logging in. So I deselect guest and select "editor" role. But pw won't let me.

I can get around this problem offcourse by adding other pages etc. but I wanted to put it out for reconsideration. Maybe: Dissallow only if "404 page is shown" is selected and allow if "show login page" is selected.

Or maybe I'm missing a point?

Link to comment
Share on other sites

The purpose here is mainly to reduce the possibility that someone takes their entire site down by clicking the wrong thing. Too likely to cause problems and support burden, so decided to make the guest role required at the root. But it's easy to get around. If you don't want your homepage accessible, add a line at the top of your template:

if($user->isGuest()) throw new Wire404Exception('page not found');

If you want that for the whole site then put it in your header include or main output file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...