###################################
# Stick the following in a view somewhere
##################################
from django.http import HttpResponseRedirect
from django.contrib.auth.models import Group
from django.contrib.flatpages.views import flatpage

# Use this wrapper view to patrol the specific areas
def restricted_flatpage(request,group_name=None,redirect_to="/restricted/"):
    """Restricts access to flatpage to group specified by group_name and superuser"""
    if not request.user or request.user.is_anonymous() or not group_name:
        return HttpResponseRedirect(redirect_to)
    try:
        if request.user.is_superuser:
            return flatpage(request,request.path)
        g=Group.objects.get(name=group_name)
        if g.user_set.filter(id=request.user.id).count():
            return flatpage(request,request.path)
    except Group.DoesNotExist: pass
    return HttpResponseRedirect(redirect_to)

##################################
# Then stick this in the appropriate urls.py
####################################
    (r'^employee-benefits/', restricted_flatpage,{"group_name":"corporate"}),
    (r'^company', restricted_flatpage,{"group_name":"corporate"}),