Random restricted partitions