I don't think the underlined parts are functioning as nouns. I suppose they're adverbial, showing under what circumstances the thing is allowed/permitted. "
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.