def get_all_model_perms(model):
    """Returns an iterator of all model permissions."""
    meta = model._meta
    app_label = meta.app_label
    model_name = meta.model_name
    for p in meta.permissions:
        yield '%s.%s' % (app_label, p[0])
    for p in meta.default_permissions:
        yield '%s.%s_%s' % (app_label, p, model_name)
