def METHOD_NAME(instance, group_name, perms):
    """
    Create group object permissions.
    """
    ct = ContentType.objects.get(
        app_label="base", model=instance.__class__.__name__.lower()
    )
    for perm_name in perms:
        perm = Permission.objects.get(content_type=ct, codename=perm_name)
        group = getattr(instance, f"{group_name}_group")
        GroupObjectPermission.objects.get_or_create(
            object_pk=instance.pk, content_type=ct, group=group, permission=perm
        )