Check if roles is an array and if key exists.