Non-public web views

The documentation on web views mentions

Web views can also be generated to create more controlled views for
users who may login but still do not have access to the Desk.

But there is no example, and I don’t see anything resembling an auth check on the existing web views.

How do you block access to a particular view/generator if the user is not logged in?


Say you have /Sales Invoice as the web view.

If you haven’t given ‘Guest’ user/role access to such documents, it will show you a message asking you to login.

However, Blog Post has Guest permissions and hence, you can see:

I should have mentioned, this is for a custom view not part of any Document (I put my own .html and .py in the templates folder)

I assume I have to put some kind of check in the get_context call, I just don’t what I’m supposed to call for the auth check.

Check this:

I can work with ithis.