private function computeAccess($and, $xor, $bit)
    {
        $xorBit = \databox_status::bitIsSet($xor, $bit);
        $andBit = \databox_status::bitIsSet($and, $bit);

        if (!$xorBit && !$andBit) {
            return self::FLAG_ALLOW_BOTH;
        }

        if ($xorBit && $andBit) {
            return self::FLAG_SET_ONLY;
        }

        return self::FLAG_UNSET_ONLY;
    }
private function computeAccess($and, $xor, $bit)
    {
        $xorBit = \databox_status::bitIsSet($xor, $bit);
        $andBit = \databox_status::bitIsSet($and, $bit);

        if (!$xorBit && !$andBit) {
            return self::FLAG_ALLOW_BOTH;
        }

        if ($xorBit && $andBit) {
            return self::FLAG_SET_ONLY;
        }

        return self::FLAG_UNSET_ONLY;
    }
private function computeAccess ( $ and , $ xor , $ bit ) { $ xorBit = \ databox_status :: bitIsSet ( $ xor , $ bit ) ; $ andBit = \ databox_status :: bitIsSet ( $ and , $ bit ) ; if ( ! $ xorBit && ! $ andBit ) { return self :: FLAG_ALLOW_BOTH ; } if ( $ xorBit && $ andBit ) { return self :: FLAG_SET_ONLY ; } return self :: FLAG_UNSET_ONLY ; }
Truth table for status rights

+-----------+
| and | xor |
+-----------+
|  0  |  0  | -> BOTH STATES ARE CHECKED
+-----------+
|  1  |  0  | -> UNSET STATE IS CHECKED
+-----------+
|  0  |  1  | -> UNSET STATE IS CHECKED (not possible)
+-----------+
|  1  |  1  | -> SET STATE IS CHECKED
+-----------+
Truth table for status rights