This is fine except for the fact that you are not taking advantage of the fact that `mode` can be a bit mask, allowing the caller to check for multiple permissions simultaneously. Right now we can only check for one permission at a time.

Changing to support the bit masks should be simple enough to make it worthwhile :smile: