I would like to implement a permission system for my API wherein the endpoints available to admins are a superset of those available to superusers, which are a superset of those of regular users. What is an elegant way to do this in Servant?
Should I use several AuthProtect combinators, each of which return a User, but only if the authenticated user's privilege level is high enough? This seems like it would perhaps require writing mostly identical code each time, so maybe it's not ideal, especially if there are many groups. Is there a better way?