Add doc and examples for attributes allow/warn/deny/forbid.

Fix #7821.