How to make a Firebase rule making sure you can only enter certain things in a field?
<p>Let's say I'm using Firebase to run a message board in which every post must first be approved by a moderator.</p>

<p>Thus, a post can have one of three "statuses":</p>

<ul>
<li>Unreviewed</li>
<li>Approved</li>
<li>Rejected</li>
</ul>

<p>The only way I've found to make this rule is like so:</p>

<pre><code>{
    "rules": {
        "posts": {
            ".write": "newData.child('status').val() == 'unreviewed' || newData.child('status').val() == 'approved' || newData.child('status').val() == 'rejected"
        }
    }
}
</code></pre>

<p>This seems very inefficient and not DRY. Is there another way of making sure a field's value is always one of a few values?</p>