Would this be something you guys recommend to check for the admin role (or any other role for that matter). Anything wrong with this? This would simply check the user calling the method, see if he has that role, and return true if he does, or throw an error if not.
Following up on @dblythy’s solution, a minimal optimization is to use count() instead of first(), so that isAdmin = (count === 1). No idea if the difference in performance is even measurable, but I have a better feeling when no unused data is being transmitted