That's precisely how it works in FreeBSD (https://www.freebsd.org/cgi/man.cgi?capsicum).
There's also openat on linux. My point is that the general, practiced approach is not capability based.
There's also openat on linux. My point is that the general, practiced approach is not capability based.