Turret = Turret or {}
Turret.ContainerAccess = {}

function Turret.ContainerAccess.TopCon(vehicle, part, chr)
    if chr:getVehicle() then
        return false
    end
    local AmmoBox = vehicle:getPartById("AmmoCan")
    if AmmoBox and AmmoBox:getInventoryItem() then
        if not vehicle:isInArea(part:getArea(), chr) then
            return false
        end
        local modData = vehicle:getModData()
        if not modData.User then
            return false
        end
        if not modData.User[chr:getUsername()] then
            return false
        end
        return true
    else
        return false
    end
end
