Expose read_only parameter to templates.

Change-Id: I199e5503ad7a61ddfe564205f67d6fc7f4c5aac5