def has_model_permissions(entity, model, perms, app):
    for p in perms:
        if not entity.has_perm('%s.%s_%s' % (app, p, model.__name__)):
            return False
How do I use Django groups and permissions?