def get_perms(obj, fields, suffix):
    groups = get_groups_with_perms(obj, attach_perms=True) if obj else {}
    perms = {}
    for field in fields:
        perms[field] = list(key for (key, val) in groups.items() if field + suffix in val)
    return perms
Get all groups which have perms on an object, categorized by permission names (fields)
dataset/ETHPy150Open Wtower/django-ninecms/ninecms/utils/perms.py/get_perms