def METHOD_NAME(sender, instance, action, reverse, pk_set, **kwargs):
    if not action.startswith('post'):
        return
    if reverse:
        group_ids = [instance.id]
        user_ids = pk_set
        org_id = instance.org_id
    else:
        group_ids = pk_set
        user_ids = [instance.id]
        group = UserGroup.objects.get(id=list(group_ids)[0])
        org_id = group.org_id
    has_group_perm = AssetPermission.user_groups.through.objects\
        .filter(usergroup_id__in=group_ids).exists()
    if not has_group_perm:
        return
    UserPermTreeExpireUtil().expire_perm_tree_for_users_orgs(user_ids, [org_id])