Hi Vic,
Wagtail will provide group-based access restrictions as a built-in feature in the near future (it hasn't made it into 1.1, but will hopefully be in 1.2 in a month or so's time). For now, you can implement a custom 'serve' method on ProjectPage <
http://docs.wagtail.io/en/v1.0/reference/pages/model_recipes.html#overriding-the-serve-method>, which works in a similar way to a Django view function:
from django.shortcuts import redirect
class ProjectPage(Page):
...
def serve(self, request):
project_groups = [pg.group for pg in self.group.all()]
if any([(user_group in project_groups) for user_group in request.user.groups.all()]):
# User is in the required group - proceed to serve the page as normal
return super(ProjectPage, self).serve(request)
else:
# User is not in the required group - redirect them away
return redirect('/path/to/login')
Cheers,
- Matt