Restrict viewing front end to specific group permissions How can I restrict content frontend to specific user groups?
There seems no sensible way to do this out of the box.
For example group permissions in CP are all about CP - there is no view option.

Never had a use case for this before today but have one now and finding Craft3 coming up short :(

Scenario is a support portal where different companies can provide user specific content. Idea is login with company id (done that ok via a plugin) but then once logged in they get redirected to content for that specific company.

So I have two probs now: redirect to company 'home page', and restrict access to content. I've considered splitting content into sites and pairing users with sites. I've considered section root parent and checking permissions for top of tree in twig. I'm thinking restricting per section is best and adding company homepage as entry field in user field or user group field and managing access via plugin + twig but its all feeling very heavy handed....
If you setup a User Group with the same handle as the Site you want them to have access to, this could be fairly easy.
Let's say you have a site called &quot;Acme&quot; setup in the Sites settings. You also created a corresponding User Group called &quot;Acme.&quot; The handles for the Acme Site and Acme User Group are both &quot;acme.&quot;
When you're on the Acme site's front-end, possibly example.com/acme depending on how you set up your site URLs, the {{ currentSite.handle }} tag will return acme.
To test if a user has access to content in your template you can use something like {% if currentUser.isInGroup(currentSite.handle) %}.
Adding this to any template will prevent unauthorized access if a user is not in a group:
{% if not currentUser.isInGroup(currentSite.handle) %}  
  {% exit 403 %}
{% endif %}

You would also probably want to allow admins or users groups who can access the control panel:
allow admins:

{% if not currentUser.isInGroup(currentSite.handle) or not currentUser.admin %}  
  {% exit 403 %}
{% endif %}

... or allow any user that can access the control panel:

{% if not currentUser.isInGroup(currentSite.handle) or not currentUser.can('accessCp') %}  
  {% exit 403 %}
{% endif %}

Redirecting to the correct site after a login page is a little trickier because users can belong to more than one group.
But assuming that users only belong to one group you could redirect users to a sort of &quot;routing&quot; template that's only job is to send you to the right place.
{% set firstGroup = currentUser.getGroups()[0] ?? null %}

{% if firstGroup %}
  {% redirect firstGroup.handle %}
{% else %}
  ... default redirect or error 
{% endif %}

Also, here's a list of permission you can use with the currentUser.can() method:
https://docs.craftcms.com/v3/users.html#permissions