You line of thinking is correct.
| to combine flags.
& to test a flag.
& ~() to remove a flag.