limit add to cart for registered customers

hi, how can i limit the add to cart function to customers that have a valid assigned customer code?

sorry, i meant don`t have a valid assigned customer code.