def is_owner(user, record):
    """Check if user is an owner of the record."""
    user_id = int(user.get_id()) if user and user.is_authenticated else None
    return user_id in record.get('_deposit', {}).get('owners', [])