You can stuff the logic of &quot;who can do what&quot; somewhere else. eg:<p>var permissions = {
    &quot;Superadmin&quot;: [&quot;selfdestruct&quot;,...],
    &quot;Admin&quot;: [&quot;ban&quot;,...],
    &quot;Plebe&quot;: [&quot;post&quot;,...]
};<p>function roleCanDo(action, role) {
    return permissions[role].indexOf(action) &gt; -1;
}<p>Your check would look like: 
if (roleCanDo(&quot;someaction&quot;, user.getRole()))<p>Sorry if JS isn&#x27;t your thing.