code: function checkPermissions (access: number, uid: number, gid: number, stat: Stat): boolean {
    return (access & resolveOwnership(uid, gid, stat)) === access;
  }
docs: Checks the desired permissions with user id and group id against the metadata of an iNode.
  The desired permissions can be bitwise combinations of constants.R_OK, constants.W_OK and constants.X_OK.