Website as Corporate intranet

I am exploring using the whole website (home, topbar, sidebar, web pages etc) as a corporate intranet portal, which is not accessible to the public. Is this possible by using roles & permissions?
or do I have to use the portal modules?

As I understand it, permissions apply to desk and api, but not to the portal. The portal is really intended for the customer, supplier, student, and patient roles.

You could probably make it work, but I suspect it would require a fairly significant rewrite of code.

Can you clarify what you want to do with the portal rather than the desk itself?

I am using this on one of my client.

def get_context(context):
if frappe.session.user == “Guest” and !=“System User”:
frappe.local.flags.redirect_location = “/login”
raise frappe.Redirect
forcing everyone to login before they could access to the Intranet

Thanks @peterg. Want to explore use of website functions such as web pages, web templates, blog, profile etc for employees (not external) to consume news, announcements, policies, procedures, internal job post, staff offers, HR & IT etc.
Holding company has 20+ department and each subsidiary company as many, so basically an intranet from holding co. of info pages and links.
Whereas desk apps is more suited for transactional/record based apps by power users for each company.
Is my understanding correct? Erpnext has 3 interfaces,

  1. Website = public
  2. Portal = external partners
  3. Desk = employees
    Want to make website internal. Thanks.

Thanks @sione , will check out your advice. Looks promising.

Ahh, of course! You explicitly said website, but I had it in my head for some reason that you were talking about the portal documents. In that case, what you’re describing should work perfectly, and what sione describes should do the trick.

@sione, can please share where best to make this redirect for the whole website?

@slick On the www folder you will have your index.html file for your website, that where I used that function to redirect all employee to login before they could see the website. You could have a landing page with a full screen images or anything you want.