def user_can_delete_greylisting(user, greylisting):
    """
    Is a user allowed to remove a guest from the greylist?

    Arguments:
        user: User
        greylisting: GreylistedGuest

    Returns: bool
    """
    return (
        greylisting.addedBy == user or
        user.has_perm('PartyList.can_delete_any_greylisted_guest')
    )