Check and Check
by in CodeSOD on 2026-06-08Today's anonymous submitter sends us a React view that presents some admin options. Of course, it should only show us those admin options if the user is authorized to do that. So let's see how they implemented it:
{(isAdmin || canSeeResults) && (
<div>
<p>Admin Actions</p>
{(isAdmin || canSeeResults) && (
<div>
<button> Show Results </button>
</div>
)}
</div>
)}