title: How can I efficiently restrict a non-CMS page view to a user group in wagtail with 'permissions_required' hook?
body: <p>I have an app within my wagtail site which uses several pages constructed in views.py (here because they contain complex-ish processing of forms and data and do not need any CMS functionality). One of these views, I want to restrict to users of a specific group.</p>
  
  <p>For other pages, I use a <code>@logon required</code> mixin, which works fine. I can write some code which uses something like <code>def has_group(user, group_name):
      return user.groups.filter(name=group_name).exists()</code>, but this seems messy when wagtail has a nice built in permissions model. Therefore, I am trying to use the following hook in wagtail_hook.py:</p>
  
  <pre><code>from django.contrib.auth.models import Permission
  from wagtail.core import hooks
  
  @hooks.register('register_permissions')
  def view_committee_page():
      return Permission.objects.filter(codename="view_committee_page")
  </code></pre>
  
  <p>This isn't showing up in wagtail admin under group object permissions as I believe it should.
  My understanding is only based on the odd example I've found using Wagtail v1.X. The documentation is vague on this specific hook: <a href="https://docs.wagtail.io/en/v2.5.1/reference/hooks.html#register-permissions" rel="nofollow noreferrer">https://docs.wagtail.io/en/v2.5.1/reference/hooks.html#register-permissions</a></p>
  
  <p>The only modification I've made to the examples I've seen (eg. here: <a href="https://stackoverflow.com/questions/37663893/wagtail-set-additional-permissions-for-mypage">Wagtail set additional permissions for MyPage</a> ) is to update <code>wagtail.wagtailcore</code> to <code>wagtail.core</code> as per 2.0 release notes.</p>
  
  <p>I know my wagtail_hooks.py file is being picked up correctly as I have another hook in there working as expected.</p>
  
  <p>Am I missing something? Is there a more up to date way to solve this problem?</p>